Class: Barometer::Noaa::CurrentApi

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

Instance Method Summary collapse

Constructor Details

#initialize(query) ⇒ CurrentApi

Returns a new instance of CurrentApi.



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

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

Instance Method Details

#paramsObject



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

def params
  nil
end

#unwrap_nodesObject



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

def unwrap_nodes
  ['current_observation']
end

#urlObject



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

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