Class: Barometer::Data::Attribute::Temperature

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

Instance Method Summary collapse

Instance Method Details

#coerce(value, *args) ⇒ Object



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

def coerce(value, *args)
  value.is_a?(Barometer::Data::Temperature) ? value : Barometer::Data::Temperature.new(*value)
end