Class: PointForecast

Inherits:
Weatherzone::Resource show all
Defined in:
lib/weatherzone/resources/point_forecast.rb

Constant Summary collapse

WIND_DIRECTIONS =
{
  :N => "North",
  :NNE => "North North East",
  :NE => "North East",
  :ENE => "East North East",
  :E => "East",
  :ESE => "East South East",
  :SE => "South East",
  :SSE => "South South East",
  :S => "South",
  :SSW => "South South West",
  :SW => "South West",
  :WSW => "West South West",
  :W => "West",
  :WNW => "West North West",
  :NW => "North West",
  :NNW => "North North West"
}

Instance Method Summary collapse

Methods inherited from Weatherzone::Resource

has_attribute, has_elements, inherited, #settings

Instance Method Details

#dew_pointObject



37
38
39
# File 'lib/weatherzone/resources/point_forecast.rb', line 37

def dew_point
  self.dp_c ? "#{self.dp_c}#{self.dp_c_units}" : "n/a"
end

#meridian_indicatorObject



25
26
27
# File 'lib/weatherzone/resources/point_forecast.rb', line 25

def meridian_indicator
  Time.parse(self.time).strftime("%p").downcase
end

#relative_humidityObject



33
34
35
# File 'lib/weatherzone/resources/point_forecast.rb', line 33

def relative_humidity
  self.rh ? "#{self.rh}#{self.rh_units}" : "n/a"
end

#wind_dir_compass_longObject



29
30
31
# File 'lib/weatherzone/resources/point_forecast.rb', line 29

def wind_dir_compass_long
  WIND_DIRECTIONS[self.wind_dir_compass.to_sym] if self.wind_dir_compass
end