Class: Trailblazer::Operation::Pipetree::Step
- Inherits:
-
Object
- Object
- Trailblazer::Operation::Pipetree::Step
- Includes:
- Uber::Callable
- Defined in:
- lib/trailblazer/operation/pipetree.rb
Overview
Allows defining dependencies and inject/override them via runtime options, if desired.
Instance Method Summary collapse
- #call(input, options) ⇒ Object
-
#initialize(step, dependencies = {}) ⇒ Step
constructor
A new instance of Step.
Constructor Details
#initialize(step, dependencies = {}) ⇒ Step
Returns a new instance of Step.
132 133 134 |
# File 'lib/trailblazer/operation/pipetree.rb', line 132 def initialize(step, dependencies={}) @step, @dependencies = step, dependencies end |
Instance Method Details
#call(input, options) ⇒ Object
136 137 138 139 140 |
# File 'lib/trailblazer/operation/pipetree.rb', line 136 def call(input, ) @dependencies.each { |k, v| [k] ||= v } # not sure i like this, but the step's API is cool. @step.(input, ) end |