Class: Weather::Night
- Inherits:
-
FutureEstimate
- Object
- FutureEstimate
- Weather::Night
- Defined in:
- lib/night.rb
Instance Attribute Summary collapse
-
#doc ⇒ Object
readonly
Returns the value of attribute doc.
Instance Method Summary collapse
-
#initialize(doc) ⇒ Night
constructor
A new instance of Night.
-
#part ⇒ Object
Select night part in the doc.
Methods inherited from FutureEstimate
#description, #high, #humidity, #icon, #low, #precipitation, #sunrise, #sunset, #wind
Constructor Details
#initialize(doc) ⇒ Night
Returns a new instance of Night.
8 9 10 |
# File 'lib/night.rb', line 8 def initialize(doc) super(doc) end |
Instance Attribute Details
#doc ⇒ Object (readonly)
Returns the value of attribute doc.
6 7 8 |
# File 'lib/night.rb', line 6 def doc @doc end |
Instance Method Details
#part ⇒ Object
Select night part in the doc
13 14 15 16 17 18 19 20 |
# File 'lib/night.rb', line 13 def part night = nil (doc/"part").each do |d| if d.attributes["p"] == "n" night = d end end end |