Class: Barometer::Data::Attribute::Sun

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

Instance Method Summary collapse

Instance Method Details

#coerce(value) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/barometer/data/attributes/sun.rb', line 5

def coerce(value)
  if value.nil?
    Barometer::Data::Sun.new
  elsif value.is_a?(Barometer::Data::Sun)
    value
  end
end