Class: Weather::Night

Inherits:
FutureEstimate show all
Defined in:
lib/night.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#docObject (readonly)

Returns the value of attribute doc.



6
7
8
# File 'lib/night.rb', line 6

def doc
  @doc
end

Instance Method Details

#partObject

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