Module: RSchema::Coercers::Integer
Instance Method Summary collapse
Instance Method Details
#build(schema) ⇒ Object
7 8 9 |
# File 'lib/rschema/coercers/integer.rb', line 7 def build(schema) self end |
#call(value) ⇒ Object
11 12 13 14 |
# File 'lib/rschema/coercers/integer.rb', line 11 def call(value) int = Integer(value) rescue nil int ? Result.success(int) : Result.failure end |