Class: Forecast

Inherits:
Weatherzone::Resource show all
Includes:
Weatherzone::Helpers::Units
Defined in:
lib/weatherzone/resources/forecast.rb

Instance Method Summary collapse

Methods included from Weatherzone::Helpers::Units

included

Methods inherited from Weatherzone::Resource

has_attribute, has_elements, inherited, #settings

Instance Method Details

#abbr_day_nameObject



27
28
29
# File 'lib/weatherzone/resources/forecast.rb', line 27

def abbr_day_name
  self.day_name[0..2]
end

#chance_of_rainObject



35
36
37
# File 'lib/weatherzone/resources/forecast.rb', line 35

def chance_of_rain
  "#{self.prob_precip}#{self.prob_precip_units}"
end

#dateObject



31
32
33
# File 'lib/weatherzone/resources/forecast.rb', line 31

def date
  Date.parse(@date)
end

#icon_nameObject



23
24
25
# File 'lib/weatherzone/resources/forecast.rb', line 23

def icon_name
  icon_filename.split(".").first
end

#max_rainObject



43
44
45
# File 'lib/weatherzone/resources/forecast.rb', line 43

def max_rain
  self.rain_range_text.split("-")[1].to_i if rain_range_text
end

#min_rainObject



39
40
41
# File 'lib/weatherzone/resources/forecast.rb', line 39

def min_rain
  self.rain_range_text.split("-")[0].to_i if rain_range_text
end