Class: RWeatherCurrentCondition
- Inherits:
-
Object
- Object
- RWeatherCurrentCondition
- Defined in:
- lib/r_weather_current_condition.rb
Instance Attribute Summary collapse
-
#bar ⇒ Object
Returns the value of attribute bar.
-
#dewp ⇒ Object
Returns the value of attribute dewp.
-
#flik ⇒ Object
Returns the value of attribute flik.
-
#hmid ⇒ Object
Returns the value of attribute hmid.
-
#icon ⇒ Object
Returns the value of attribute icon.
-
#lsup ⇒ Object
Returns the value of attribute lsup.
-
#moon ⇒ Object
Returns the value of attribute moon.
-
#obst ⇒ Object
Returns the value of attribute obst.
-
#t ⇒ Object
Returns the value of attribute t.
-
#tmp ⇒ Object
Returns the value of attribute tmp.
-
#uv ⇒ Object
Returns the value of attribute uv.
-
#vis ⇒ Object
Returns the value of attribute vis.
-
#wind ⇒ Object
Returns the value of attribute wind.
Class Method Summary collapse
Instance Attribute Details
#bar ⇒ Object
Returns the value of attribute bar.
7 8 9 |
# File 'lib/r_weather_current_condition.rb', line 7 def @bar end |
#dewp ⇒ Object
Returns the value of attribute dewp.
7 8 9 |
# File 'lib/r_weather_current_condition.rb', line 7 def dewp @dewp end |
#flik ⇒ Object
Returns the value of attribute flik.
7 8 9 |
# File 'lib/r_weather_current_condition.rb', line 7 def flik @flik end |
#hmid ⇒ Object
Returns the value of attribute hmid.
7 8 9 |
# File 'lib/r_weather_current_condition.rb', line 7 def hmid @hmid end |
#icon ⇒ Object
Returns the value of attribute icon.
7 8 9 |
# File 'lib/r_weather_current_condition.rb', line 7 def icon @icon end |
#lsup ⇒ Object
Returns the value of attribute lsup.
7 8 9 |
# File 'lib/r_weather_current_condition.rb', line 7 def lsup @lsup end |
#moon ⇒ Object
Returns the value of attribute moon.
7 8 9 |
# File 'lib/r_weather_current_condition.rb', line 7 def moon @moon end |
#obst ⇒ Object
Returns the value of attribute obst.
7 8 9 |
# File 'lib/r_weather_current_condition.rb', line 7 def obst @obst end |
#t ⇒ Object
Returns the value of attribute t.
7 8 9 |
# File 'lib/r_weather_current_condition.rb', line 7 def t @t end |
#tmp ⇒ Object
Returns the value of attribute tmp.
7 8 9 |
# File 'lib/r_weather_current_condition.rb', line 7 def tmp @tmp end |
#uv ⇒ Object
Returns the value of attribute uv.
7 8 9 |
# File 'lib/r_weather_current_condition.rb', line 7 def uv @uv end |
#vis ⇒ Object
Returns the value of attribute vis.
7 8 9 |
# File 'lib/r_weather_current_condition.rb', line 7 def vis @vis end |
#wind ⇒ Object
Returns the value of attribute wind.
7 8 9 |
# File 'lib/r_weather_current_condition.rb', line 7 def wind @wind end |
Class Method Details
.element_value(key, value) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/r_weather_current_condition.rb', line 19 def element_value(key, value) if value.size == 1 && !value.first.is_a?(Hash) value.first else data = const_get(:"RWeather#{key.capitalize}").new value.first.each do |key, value| data.send(:"#{key}=", value.first) end data end end |
.parse(simple_xml) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/r_weather_current_condition.rb', line 9 def self.parse(simple_xml) current_condition = new cc = simple_xml['cc'].first cc.each do |key, value| current_condition.send(:"#{key}=", element_value(key, value)) end current_condition end |