Class: Pathway::State
Instance Method Summary collapse
-
#initialize(operation, values = {}) ⇒ State
constructor
A new instance of State.
- #result ⇒ Object
- #to_hash ⇒ Object (also: #to_h)
- #update(kargs) ⇒ Object
Constructor Details
#initialize(operation, values = {}) ⇒ State
Returns a new instance of State.
56 57 58 59 |
# File 'lib/pathway.rb', line 56 def initialize(operation, values = {}) @hash = operation.context.merge(values) @result_key = operation.result_key end |
Instance Method Details
#result ⇒ Object
68 69 70 |
# File 'lib/pathway.rb', line 68 def result @hash[@result_key] end |
#to_hash ⇒ Object Also known as: to_h
72 73 74 |
# File 'lib/pathway.rb', line 72 def to_hash @hash end |
#update(kargs) ⇒ Object
63 64 65 66 |
# File 'lib/pathway.rb', line 63 def update(kargs) @hash.update(kargs) self end |