Class: NoaaWeatherClient::Services::PostalCodeToCoordinate

Inherits:
Object
  • Object
show all
Includes:
RestService
Defined in:
lib/noaa_weather_client/services/postal_code_to_coordinate.rb

Constant Summary collapse

URL =
"http://graphical.weather.gov/xml/sample_products/browser_interface/ndfdXMLclient.php?listZipCodeList="

Instance Method Summary collapse

Methods included from RestService

#build_request_for_action, #object_from_response

Constructor Details

#initialize(options = {}) ⇒ PostalCodeToCoordinate

Returns a new instance of PostalCodeToCoordinate.



11
12
13
# File 'lib/noaa_weather_client/services/postal_code_to_coordinate.rb', line 11

def initialize(options = {})
  @options = options
end

Instance Method Details

#resolve(zip, options = {}) ⇒ Object



15
16
17
# File 'lib/noaa_weather_client/services/postal_code_to_coordinate.rb', line 15

def resolve(zip, options = {})
  rest_service.object_from_response(:get, build_url(zip), response_class: response_class)
end