Class: OpenWeatherAPI::Resources::ForecastDaily

Inherits:
ForecastHourly show all
Defined in:
lib/open-weather-api/resources/forecast_daily.rb

Instance Attribute Summary

Attributes inherited from Base

#api_obj

Instance Method Summary collapse

Methods inherited from ForecastHourly

#city, #city_id, #geolocation

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_daily.rb', line 5

def base_url
  return super + 'daily/'
end

#build_params(parameters = {}) ⇒ Object



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

def build_params(parameters = {})
  parameters.merge!(cnt: days)
  super(parameters)
end

#daysObject



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

def days
  @parameters[:days] || @parameters[:n_days] || @parameters[:cnt]  || @parameters[:count]
end