Class: TypedParams::Pipeline
- Inherits:
-
Object
- Object
- TypedParams::Pipeline
- Defined in:
- lib/typed_params/pipeline.rb
Instance Method Summary collapse
- #<<(step) ⇒ Object
- #call(params) ⇒ Object
-
#initialize ⇒ Pipeline
constructor
A new instance of Pipeline.
Constructor Details
#initialize ⇒ Pipeline
Returns a new instance of Pipeline.
5 |
# File 'lib/typed_params/pipeline.rb', line 5 def initialize = @steps = [] |
Instance Method Details
#<<(step) ⇒ Object
6 |
# File 'lib/typed_params/pipeline.rb', line 6 def <<(step) = steps << step |
#call(params) ⇒ Object
7 |
# File 'lib/typed_params/pipeline.rb', line 7 def call(params) = steps.reduce(params) { |v, step| step.call(v) } |