Class: Teckel::Chain::Result
- Inherits:
-
Operation::Result
- Object
- Operation::Result
- Teckel::Chain::Result
- Extended by:
- Forwardable
- Defined in:
- lib/teckel/chain/result.rb
Instance Method Summary collapse
- #deconstruct ⇒ Object
- #deconstruct_keys(keys) ⇒ Object
-
#initialize(value, success, step) ⇒ Result
constructor
A new instance of Result.
-
#step ⇒ String, Symbol
Delegates to
step.name.
Constructor Details
#initialize(value, success, step) ⇒ Result
Returns a new instance of Result.
13 14 15 16 |
# File 'lib/teckel/chain/result.rb', line 13 def initialize(value, success, step) super(value, success) @step = step end |
Instance Method Details
#deconstruct ⇒ Object
27 28 29 |
# File 'lib/teckel/chain/result.rb', line 27 def deconstruct [successful?, @step.name, value] end |
#deconstruct_keys(keys) ⇒ Object
31 32 33 34 35 |
# File 'lib/teckel/chain/result.rb', line 31 def deconstruct_keys(keys) e = super e[:step] = @step.name if keys.include?(:step) e end |
#step ⇒ String, Symbol
Delegates to step.name
25 |
# File 'lib/teckel/chain/result.rb', line 25 def_delegator :@step, :name, :step |