Class: OpenWeatherAPI::Resources::ForecastHourly

Inherits:
Base
  • Object
show all
Defined in:
lib/open-weather-api/resources/forecast_hourly.rb

Direct Known Subclasses

ForecastDaily

Instance Attribute Summary

Attributes inherited from Base

#api_obj

Instance Method Summary collapse

Methods inherited from Base

#execute, #initialize

Constructor Details

This class inherits a constructor from OpenWeatherAPI::Resources::Base

Instance Method Details

#base_urlObject



5
6
7
# File 'lib/open-weather-api/resources/forecast_hourly.rb', line 5

def base_url
  return super + 'forecast/'
end

#build_params(parameters = {}) ⇒ Object



9
10
11
# File 'lib/open-weather-api/resources/forecast_hourly.rb', line 9

def build_params(parameters = {})
  super [city, city_id, geolocation].each{ |h| break h.handle if h.can? }
end

#cityObject

Simple handlers



14
15
16
# File 'lib/open-weather-api/resources/forecast_hourly.rb', line 14

def city
  Handlers::City.new @api_obj, @parameters
end

#city_idObject



18
19
20
# File 'lib/open-weather-api/resources/forecast_hourly.rb', line 18

def city_id
  Handlers::CityID.new @api_obj, @parameters
end

#geolocationObject



22
23
24
# File 'lib/open-weather-api/resources/forecast_hourly.rb', line 22

def geolocation
  Handlers::Geolocation.new @api_obj, @parameters
end