Class: TypedParams::Pipeline

Inherits:
Object
  • Object
show all
Defined in:
lib/typed_params/pipeline.rb

Instance Method Summary collapse

Constructor Details

#initializePipeline

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) }