Class: Meteorology::Weather

Inherits:
Object
  • Object
show all
Defined in:
lib/meteorology/weather.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(time) ⇒ Weather

Returns a new instance of Weather.



5
6
7
# File 'lib/meteorology/weather.rb', line 5

def initialize(time)
  @time = time.is_a?(String) ? Time.parse(time) : time
end

Instance Attribute Details

#temperatureObject

Returns the value of attribute temperature.



3
4
5
# File 'lib/meteorology/weather.rb', line 3

def temperature
  @temperature
end

#timeObject

Returns the value of attribute time.



3
4
5
# File 'lib/meteorology/weather.rb', line 3

def time
  @time
end