Module: Philiprehberger::SchemaValidator::Coercer

Defined in:
lib/philiprehberger/schema_validator/coercer.rb

Constant Summary collapse

BOOLEAN_TRUE =
%w[true 1 yes on].freeze
BOOLEAN_FALSE =
%w[false 0 no off].freeze

Class Method Summary collapse

Class Method Details

.coerce(value, type) ⇒ Object



9
10
11
12
13
# File 'lib/philiprehberger/schema_validator/coercer.rb', line 9

def self.coerce(value, type)
  return value if value.nil?

  send(:"coerce_#{type}", value)
end