Module: OnTheSnow::Resort::Weather
- Included in:
- Resort
- Defined in:
- lib/onthesnow/resort/weather.rb
Instance Method Summary collapse
- #condition ⇒ Object
- #date ⇒ Object
- #degree ⇒ Object
- #degree_in_c ⇒ Object
- #degree_in_f ⇒ Object
- #weather ⇒ Object
Instance Method Details
#condition ⇒ Object
25 26 27 |
# File 'lib/onthesnow/resort/weather.rb', line 25 def condition @condition ||= dom(:weather).search(".condition").text unless dom(:weather).empty? end |
#date ⇒ Object
9 10 11 |
# File 'lib/onthesnow/resort/weather.rb', line 9 def date @date ||= dom(:weather).search(".today p").first.text unless dom(:weather).empty? end |
#degree ⇒ Object
13 14 15 |
# File 'lib/onthesnow/resort/weather.rb', line 13 def degree @degree ||= dom(:weather).search(".temperature").first.text unless dom(:weather).empty? end |
#degree_in_c ⇒ Object
21 22 23 |
# File 'lib/onthesnow/resort/weather.rb', line 21 def degree_in_c @degree_in_c ||= degree.split(" / ")[1] unless dom(:weather).empty? end |
#degree_in_f ⇒ Object
17 18 19 |
# File 'lib/onthesnow/resort/weather.rb', line 17 def degree_in_f @degree_in_f ||= degree.split(" / ")[0] unless dom(:weather).empty? end |
#weather ⇒ Object
5 6 7 |
# File 'lib/onthesnow/resort/weather.rb', line 5 def weather @weather ||= {"date" => date, "temperature" => {"f" => degree_in_f, "c" => degree_in_c}, "condition" => condition} unless dom(:weather).empty? end |