class NoaaWeatherClient::Services::PostalCodeToCoordinate

Constants

URL

Attributes

options[R]

Public Class Methods

new(options = {}) click to toggle source
# File lib/noaa_weather_client/services/postal_code_to_coordinate.rb, line 11
def initialize(options = {})
  @options = options
end

Public Instance Methods

resolve(zip, options = {}) click to toggle source
# 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

Private Instance Methods

build_url(zip) click to toggle source
# File lib/noaa_weather_client/services/postal_code_to_coordinate.rb, line 31
def build_url(zip)
  "#{URL}#{zip}"
end
response_class() click to toggle source
# File lib/noaa_weather_client/services/postal_code_to_coordinate.rb, line 27
def response_class
  options.fetch(:response_class, Responses::LatLonList)
end
rest_service() click to toggle source
# File lib/noaa_weather_client/services/postal_code_to_coordinate.rb, line 23
def rest_service
  options.fetch(:rest_service, self)
end