Class: Pipetree::Flow

Inherits:
Array
  • Object
show all
Includes:
Inspect, Operators, Pipetree::Function::Insert::Macros
Defined in:
lib/pipetree/flow.rb

Overview

yes, we could inherit, and so on.

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

Methods included from Pipetree::Function::Insert::Macros

#insert!

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

Instance Method Details

#call(input, options) ⇒ Object

Actual implementation of Pipetree:Flow. Yes, it’s that simple!



53
54
55
56
57
58
59
60
# File 'lib/pipetree/flow.rb', line 53

def call(input, options)
  input = [Right, input]

  inject(input) do |memooo, step|
    last, memo = memooo
    step.call(last, memo, options)
  end
end