Class: Attrocity::Coercers::Integer
- Inherits:
-
Object
- Object
- Attrocity::Coercers::Integer
- Defined in:
- lib/attrocity/coercers/integer.rb
Instance Method Summary collapse
Instance Method Details
#coerce(value) ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/attrocity/coercers/integer.rb', line 4 def coerce(value) if value.nil? || value.to_s.empty? nil else Integer(value) end end |