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
148 149 150 |
# File 'lib/business_flow/step.rb', line 148 def opts @opts end |
Instance Method Details
#condition ⇒ Object
158 159 160 161 162 163 164 165 166 |
# File 'lib/business_flow/step.rb', line 158 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
149 150 151 |
# File 'lib/business_flow/step.rb', line 149 def input_object Inputs.new(opts[:inputs] || {}) end |
#result_factory ⇒ Object
153 154 155 156 |
# File 'lib/business_flow/step.rb', line 153 def result_factory ResultFactory.new(opts[:outputs] || {}, opts[:output] || ->(result) { result }) end |