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 |
#will_affect?(value) ⇒ Boolean
16 17 18 |
# File 'lib/rschema/coercers/integer.rb', line 16 def will_affect?(value) not value.is_a?(Integer) end |