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.
53 54 55 56 |
# File 'lib/pathway.rb', line 53 def initialize(operation, values = {}) @hash = operation.context.merge(values) @result_key = operation.result_key end |
Instance Method Details
#result ⇒ Object
65 66 67 |
# File 'lib/pathway.rb', line 65 def result @hash[@result_key] end |
#to_hash ⇒ Object Also known as: to_h
69 70 71 |
# File 'lib/pathway.rb', line 69 def to_hash @hash end |
#update(kargs) ⇒ Object
60 61 62 63 |
# File 'lib/pathway.rb', line 60 def update(kargs) @hash.update(kargs) self end |