Class: Barometer::Data::Attribute::Integer

Inherits:
Virtus::Attribute
  • Object
show all
Defined in:
lib/barometer/data/attributes/integer.rb

Instance Method Summary collapse

Instance Method Details

#coerce(value, *args) ⇒ Object



5
6
7
# File 'lib/barometer/data/attributes/integer.rb', line 5

def coerce(value, *args)
  value ? value.to_i : default_value.call
end