Class: TypedParams::Processor
- Inherits:
-
Object
- Object
- TypedParams::Processor
- Defined in:
- lib/typed_params/processor.rb
Instance Method Summary collapse
- #call(value) ⇒ Object
-
#initialize(schema:, controller: nil) ⇒ Processor
constructor
A new instance of Processor.
Constructor Details
#initialize(schema:, controller: nil) ⇒ Processor
Returns a new instance of Processor.
5 6 7 8 |
# File 'lib/typed_params/processor.rb', line 5 def initialize(schema:, controller: nil) @controller = controller @schema = schema end |
Instance Method Details
#call(value) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/typed_params/processor.rb', line 10 def call(value) params = Parameterizer.new(schema:).call(value:) pipeline = Pipeline.new pipeline << Bouncer.new(controller:, schema:) pipeline << Coercer.new(schema:) pipeline << Validator.new(schema:) pipeline << Transformer.new(controller:, schema:) pipeline.call(params) end |