Class: Barometer::Data::Attribute::Time

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

Instance Method Summary collapse

Instance Method Details

#coerce(value) ⇒ Object



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

def coerce(value)
  value.nil? || value.is_a?(::Time) ? value : Utils::Time.parse(*value)
end