Class: Barometer::Noaa::ForecastApi
- Inherits:
-
Utils::Api
- Object
- Utils::Api
- Barometer::Noaa::ForecastApi
- Defined in:
- lib/barometer/noaa/forecast_api.rb
Instance Method Summary collapse
-
#initialize(query) ⇒ ForecastApi
constructor
A new instance of ForecastApi.
- #params ⇒ Object
- #unwrap_nodes ⇒ Object
- #url ⇒ Object
Constructor Details
#initialize(query) ⇒ ForecastApi
Returns a new instance of ForecastApi.
6 7 8 |
# File 'lib/barometer/noaa/forecast_api.rb', line 6 def initialize(query) @query = ForecastQuery.new(query) end |
Instance Method Details
#params ⇒ Object
14 15 16 |
# File 'lib/barometer/noaa/forecast_api.rb', line 14 def params {format: '24 hourly', numDays: '7'}.merge(@query.to_param) end |
#unwrap_nodes ⇒ Object
18 19 20 |
# File 'lib/barometer/noaa/forecast_api.rb', line 18 def unwrap_nodes ['dwml', 'data'] end |
#url ⇒ Object
10 11 12 |
# File 'lib/barometer/noaa/forecast_api.rb', line 10 def url 'http://graphical.weather.gov/xml/sample_products/browser_interface/ndfdBrowserClientByDay.php' end |