Class: Meteorology::Weather
- Inherits:
-
Object
- Object
- Meteorology::Weather
- Defined in:
- lib/meteorology/weather.rb
Instance Attribute Summary collapse
-
#temperature ⇒ Object
Returns the value of attribute temperature.
-
#time ⇒ Object
Returns the value of attribute time.
Instance Method Summary collapse
-
#initialize(time) ⇒ Weather
constructor
A new instance of Weather.
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
#temperature ⇒ Object
Returns the value of attribute temperature.
3 4 5 |
# File 'lib/meteorology/weather.rb', line 3 def temperature @temperature end |
#time ⇒ Object
Returns the value of attribute time.
3 4 5 |
# File 'lib/meteorology/weather.rb', line 3 def time @time end |