Class: BusinessFlow::Step::ResultFactory

Inherits:
Struct
  • Object
show all
Defined in:
lib/business_flow/step.rb

Overview

Manage creating results for our step

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#default_outputObject

Returns the value of attribute default_output

Returns:

  • (Object)

    the current value of default_output



124
125
126
# File 'lib/business_flow/step.rb', line 124

def default_output
  @default_output
end

#output_callableObject

Returns the value of attribute output_callable

Returns:

  • (Object)

    the current value of output_callable



124
125
126
# File 'lib/business_flow/step.rb', line 124

def output_callable
  @output_callable
end

#outputsObject

Returns the value of attribute outputs

Returns:

  • (Object)

    the current value of outputs



124
125
126
# File 'lib/business_flow/step.rb', line 124

def outputs
  @outputs
end

Instance Method Details

#result(step_result, parameter_source) ⇒ Object



125
126
127
128
129
130
131
132
133
134
135
# File 'lib/business_flow/step.rb', line 125

def result(step_result, parameter_source)
  callable = callable_for(step_result)

  output = if callable
             parameter_source.instance_exec(step_result, &callable)
           else
             step_result
           end

  Result.new(step_result, outputs, output)
end