Class: Weathercom::Observation
- Inherits:
-
Object
- Object
- Weathercom::Observation
- Includes:
- ForecastMethods
- Defined in:
- lib/weathercom/observation.rb
Instance Attribute Summary collapse
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
Instance Method Summary collapse
- #day? ⇒ Boolean
-
#initialize(info, metadata) ⇒ Observation
constructor
A new instance of Observation.
- #sunrise_at ⇒ Object
- #sunset_at ⇒ Object
Methods included from ForecastMethods
Constructor Details
#initialize(info, metadata) ⇒ Observation
Returns a new instance of Observation.
6 7 8 9 |
# File 'lib/weathercom/observation.rb', line 6 def initialize(info, ) @info = info.dup.freeze @metadata = end |
Instance Attribute Details
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
11 12 13 |
# File 'lib/weathercom/observation.rb', line 11 def @metadata end |
Instance Method Details
#day? ⇒ Boolean
38 39 40 |
# File 'lib/weathercom/observation.rb', line 38 def day? day_ind == 'Y' end |
#sunrise_at ⇒ Object
30 31 32 |
# File 'lib/weathercom/observation.rb', line 30 def sunrise_at Time.parse(sunrise) end |
#sunset_at ⇒ Object
34 35 36 |
# File 'lib/weathercom/observation.rb', line 34 def sunset_at Time.parse(sunset) end |