Class: Barometer::Noaa::ForecastApi

Inherits:
Utils::Api
  • Object
show all
Defined in:
lib/barometer/noaa/forecast_api.rb

Instance Method Summary collapse

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

#paramsObject



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_nodesObject



18
19
20
# File 'lib/barometer/noaa/forecast_api.rb', line 18

def unwrap_nodes
  ['dwml', 'data']
end

#urlObject



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