Class: BusinessFlow::Step::Options

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

Overview

Responsible for creating objects based on our input options

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#optsObject

Returns the value of attribute opts

Returns:

  • (Object)

    the current value of opts



171
172
173
# File 'lib/business_flow/step.rb', line 171

def opts
  @opts
end

Instance Method Details

#conditionObject



183
184
185
186
187
188
189
# File 'lib/business_flow/step.rb', line 183

def condition
  opts.fetch(:condition) do
    if_stmts = opts[:if]
    unless_stmts = opts[:unless]
    ConditionList.new(if_stmts, unless_stmts) if if_stmts.present? || unless_stmts.present?
  end
end

#input_objectObject



172
173
174
175
# File 'lib/business_flow/step.rb', line 172

def input_object
  inputs = opts[:inputs]
  inputs.present? ? Inputs.new(inputs) : nil
end

#result_factoryObject



177
178
179
180
181
# File 'lib/business_flow/step.rb', line 177

def result_factory
  ResultFactory.new(opts[:outputs],
                    opts[:output],
                    opts[:default_output])
end