Class: Barometer::WeatherService::Noaa::CurrentApi

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

Instance Attribute Summary

Attributes inherited from Utils::Api

#query

Instance Method Summary collapse

Methods inherited from Utils::Api

#current_query, #get

Constructor Details

#initialize(query) ⇒ CurrentApi

Returns a new instance of CurrentApi.



7
8
9
# File 'lib/barometer/weather_services/noaa/current_api.rb', line 7

def initialize(query)
  @query = CurrentQuery.new(query)
end

Instance Method Details

#paramsObject



15
16
17
# File 'lib/barometer/weather_services/noaa/current_api.rb', line 15

def params
  nil
end

#unwrap_nodesObject



19
20
21
# File 'lib/barometer/weather_services/noaa/current_api.rb', line 19

def unwrap_nodes
  ['current_observation']
end

#urlObject



11
12
13
# File 'lib/barometer/weather_services/noaa/current_api.rb', line 11

def url
  "http://w1.weather.gov/xml/current_obs/#{@query.to_param}.xml"
end