Class: Pipetree::Flow
- Inherits:
-
Object
- Object
- Pipetree::Flow
- Includes:
- Inspect, Operators, Pipetree::Function::Insert::Macros
- Defined in:
- lib/pipetree/flow.rb
Defined Under Namespace
Modules: Inspect, Operators Classes: And, On, Stay, StepMap
Constant Summary collapse
- Left =
Directions emitted by steps.
Class.new
- Right =
Class.new
Instance Method Summary collapse
-
#call(input, options) ⇒ Object
Actual implementation of Pipetree:Flow.
-
#initialize(*args) ⇒ Flow
constructor
A new instance of Flow.
Methods included from Pipetree::Function::Insert::Macros
Methods included from Operators
#%, #&, #<, #>, #>>, #_insert, #index
Methods included from Inspect
#inspect_func, #inspect_line, #inspect_row, #inspect_rows
Methods included from Inspect
#inspect, #inspect_func, #inspect_line, #inspect_object, #inspect_proc, #inspect_row, #inspect_rows
Constructor Details
Instance Method Details
#call(input, options) ⇒ Object
Actual implementation of Pipetree:Flow. Yes, it’s that simple!
65 66 67 68 69 70 71 72 |
# File 'lib/pipetree/flow.rb', line 65 def call(input, ) input = [Right, input] @steps.inject(input) do |memooo, step| last, memo = memooo step.call(last, memo, ) end end |