Class: ComposableAgents::RunInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/composable_agents/run_info.rb

Overview

Store runtime information about a run

Instance Method Summary collapse

Constructor Details

#initializeRunInfo

Constructor



5
6
7
# File 'lib/composable_agents/run_info.rb', line 5

def initialize
  @properties = {}
end

Instance Method Details

#publish(**kwargs) ⇒ Object

Publish properties

Parameters:

  • kwargs (Hash{Symbol => Object})

    Set of properties to publish



12
13
14
15
16
17
# File 'lib/composable_agents/run_info.rb', line 12

def publish(**kwargs)
  kwargs.each do |name, value|
    @properties[name] = value
    singleton_class.define_method(name) { @properties.fetch(name) } unless singleton_class.respond_to?(name)
  end
end