Class: Pipetree::Flow::And

Inherits:
Object
  • Object
show all
Defined in:
lib/pipetree/flow.rb

Overview

Call step proc and return (Right || Left).

Direct Known Subclasses

Stay

Instance Method Summary collapse

Constructor Details

#initialize(proc) ⇒ And

Returns a new instance of And.



92
93
94
# File 'lib/pipetree/flow.rb', line 92

def initialize(proc)
  @proc = proc
end

Instance Method Details

#call(last, input, options) ⇒ Object



96
97
98
# File 'lib/pipetree/flow.rb', line 96

def call(last, input, options)
  @proc.(input, options) ? [Right, input] : [Left,  input]
end