Class: BusinessFlow::Step::Options
- Inherits:
-
Struct
- Object
- Struct
- BusinessFlow::Step::Options
- Defined in:
- lib/business_flow/step.rb
Overview
Responsible for creating objects based on our input options
Instance Attribute Summary collapse
-
#opts ⇒ Object
Returns the value of attribute opts.
Instance Method Summary collapse
Instance Attribute Details
#opts ⇒ Object
Returns the value of attribute opts
134 135 136 |
# File 'lib/business_flow/step.rb', line 134 def opts @opts end |
Instance Method Details
#condition ⇒ Object
144 145 146 147 148 149 150 151 152 |
# File 'lib/business_flow/step.rb', line 144 def condition opts.fetch(:condition) do if_stmts = opts[:if] unless_stmts = opts[:unless] if if_stmts.present? || unless_stmts.present? ConditionList.new(if_stmts, unless_stmts) end end || proc { true } end |
#input_object ⇒ Object
135 136 137 |
# File 'lib/business_flow/step.rb', line 135 def input_object Inputs.new(opts[:inputs] || {}) end |
#result_factory ⇒ Object
139 140 141 142 |
# File 'lib/business_flow/step.rb', line 139 def result_factory ResultFactory.new(opts[:outputs] || {}, opts[:output] || ->(result) { result }) end |