Module: Laminar::Flow::InstanceMethods

Defined in:
lib/laminar/flow.rb

Overview

Add instance methods and attributes

Instance Method Summary collapse

Instance Method Details

#callObject

Initiates evaluation of the flow.

Parameters:

  • object

    the context/input on which the flow will operate.



107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/laminar/flow.rb', line 107

def call(*)
  return context if flowspec.nil?

  validate_required_context
  step = flowspec.steps[flowspec.first_step]
  loop do
    break unless invoke_step(step)

    step = next_step(step)
  end
  context
end

#flowspecFlowSpec

Returns the flow specification for the class.

Returns:

  • (FlowSpec)

    the flow specification for the class.



101
102
103
# File 'lib/laminar/flow.rb', line 101

def flowspec
  self.class.flowspec
end