Class: Committee::SchemaValidator::HyperSchema::ParameterCoercer

Inherits:
Object
  • Object
show all
Defined in:
lib/committee/schema_validator/hyper_schema/parameter_coercer.rb

Instance Method Summary collapse

Constructor Details

#initialize(params, schema, options = {}) ⇒ ParameterCoercer

Returns a new instance of ParameterCoercer.



7
8
9
10
11
12
13
# File 'lib/committee/schema_validator/hyper_schema/parameter_coercer.rb', line 7

def initialize(params, schema, options = {})
  @params = params
  @schema = schema

  @coerce_date_times = options.fetch(:coerce_date_times, false)
  @coerce_recursive = options.fetch(:coerce_recursive, false)
end

Instance Method Details

#call!Object



15
16
17
# File 'lib/committee/schema_validator/hyper_schema/parameter_coercer.rb', line 15

def call!
  coerce_object!(@params, @schema)
end