Class: CallSheet::Step Private
- Inherits:
-
Object
- Object
- CallSheet::Step
- Includes:
- Wisper::Publisher
- Defined in:
- lib/call_sheet/step.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #call_args ⇒ Object readonly private
- #operation ⇒ Object readonly private
- #step_name ⇒ Object readonly private
Instance Method Summary collapse
- #arity ⇒ Object private
- #call(input) ⇒ Object private
-
#initialize(step_name, operation, call_args = []) ⇒ Step
constructor
private
A new instance of Step.
- #with_call_args(*call_args) ⇒ Object private
Constructor Details
#initialize(step_name, operation, call_args = []) ⇒ Step
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Step.
13 14 15 16 17 |
# File 'lib/call_sheet/step.rb', line 13 def initialize(step_name, operation, call_args = []) @step_name = step_name @operation = operation @call_args = call_args end |
Instance Attribute Details
#call_args ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
11 12 13 |
# File 'lib/call_sheet/step.rb', line 11 def call_args @call_args end |
#operation ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
10 11 12 |
# File 'lib/call_sheet/step.rb', line 10 def operation @operation end |
#step_name ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
9 10 11 |
# File 'lib/call_sheet/step.rb', line 9 def step_name @step_name end |
Instance Method Details
#arity ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
36 37 38 |
# File 'lib/call_sheet/step.rb', line 36 def arity operation.arity end |
#call(input) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/call_sheet/step.rb', line 23 def call(input) args = call_args + [input] result = operation.call(*args) result.fmap { |value| broadcast :"#{step_name}_success", value value }.or { |value| broadcast :"#{step_name}_failure", *args, value Left(StepFailure.new(step_name, value)) } end |
#with_call_args(*call_args) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
19 20 21 |
# File 'lib/call_sheet/step.rb', line 19 def with_call_args(*call_args) self.class.new(step_name, operation, call_args) end |