Module: Usps::Api::Endpoints::CityStateLookup
- Included in:
- Usps::Api::Endpoints
- Defined in:
- lib/usps/api/endpoints/city_state_lookup.rb
Instance Method Summary collapse
-
#city_state_lookup(options = {}) ⇒ Object
City/State Lookup API returns the city and state corresponding to the given ZIP Code.
Instance Method Details
#city_state_lookup(options = {}) ⇒ Object
City/State Lookup API returns the city and state corresponding to the given ZIP Code. The CityStateLookup API processes up to five lookups per request.
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/usps/api/endpoints/city_state_lookup.rb', line 15 def city_state_lookup( = {}) throw ArgumentError.new('Required arguments :city_state_lookup_request missing') if [:city_state_lookup_request].nil? throw ArgumentError.new('Required arguments :city_state_lookup_request, :zip_code missing') if [:city_state_lookup_request][:zip_code].nil? throw ArgumentError.new('Required arguments :city_state_lookup_request, :zip_code, :zip5 missing') if [:city_state_lookup_request][:zip_code][:zip5].nil? request = build_request(:city_state_lookup, ) get('https://secure.shippingapis.com/ShippingAPI.dll', { API: 'CityStateLookup', XML: request, }) end |