Class: Barometer::Data::Attribute::Distance

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

Instance Method Summary collapse

Instance Method Details

#coerce(value) ⇒ Object



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

def coerce(value)
  value.is_a?(Barometer::Data::Distance) ? value : Barometer::Data::Distance.new(*value)
end