Class: AgentRuby::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/agent_ruby/result.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(action:, result:) ⇒ Result

Returns a new instance of Result.



7
8
9
10
# File 'lib/agent_ruby/result.rb', line 7

def initialize(action:, result:)
  @action = action
  @result = result
end

Instance Attribute Details

#actionObject (readonly)

Returns the value of attribute action.



5
6
7
# File 'lib/agent_ruby/result.rb', line 5

def action
  @action
end

#resultObject (readonly)

Returns the value of attribute result.



5
6
7
# File 'lib/agent_ruby/result.rb', line 5

def result
  @result
end

Class Method Details

.find(all, id) ⇒ Object



12
13
14
# File 'lib/agent_ruby/result.rb', line 12

def self.find(all, id)
  all.find { |r| r.action.id == id.to_i }
end