From d5b44fe1f4a2e80912d8ca2e4f09830d90cd51c0 Mon Sep 17 00:00:00 2001 From: Mike Chlipala Date: Thu, 19 Dec 2024 22:37:09 -0800 Subject: [PATCH] Make metadata public --- lib/temporal/activity/context.rb | 4 ++-- spec/unit/lib/temporal/activity/context_spec.rb | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/temporal/activity/context.rb b/lib/temporal/activity/context.rb index dd330520..e876270c 100644 --- a/lib/temporal/activity/context.rb +++ b/lib/temporal/activity/context.rb @@ -20,7 +20,7 @@ def initialize(connection, metadata, config, heartbeat_thread_pool) @last_heartbeat_throttled = false end - attr_reader :heartbeat_check_scheduled, :cancel_requested, :last_heartbeat_throttled + attr_reader :metadata, :heartbeat_check_scheduled, :cancel_requested, :last_heartbeat_throttled def async @async = true @@ -113,7 +113,7 @@ def name private - attr_reader :connection, :metadata, :heartbeat_thread_pool, :config, :heartbeat_mutex, :last_heartbeat_details + attr_reader :connection, :heartbeat_thread_pool, :config, :heartbeat_mutex, :last_heartbeat_details def task_token metadata.task_token diff --git a/spec/unit/lib/temporal/activity/context_spec.rb b/spec/unit/lib/temporal/activity/context_spec.rb index e9bc274b..ec343a51 100644 --- a/spec/unit/lib/temporal/activity/context_spec.rb +++ b/spec/unit/lib/temporal/activity/context_spec.rb @@ -189,4 +189,10 @@ expect(subject.name).to eq('TestActivity') end end + + describe '#metadata' do + it 'returns metadata' do + expect(subject.metadata).to eq(metadata) + end + end end