Class: Geocoder::Lookup::SmartyStreets
- Defined in:
- lib/geocoder/lookups/smarty_streets.rb
Instance Method Summary collapse
- #name ⇒ Object
- #query_url(query) ⇒ Object
- #required_api_key_parts ⇒ Object
-
#supported_protocols ⇒ Object
required by API as of 26 March 2015.
Methods inherited from Base
#cache, #handle, #initialize, #map_link_url, #search
Constructor Details
This class inherits a constructor from Geocoder::Lookup::Base
Instance Method Details
#name ⇒ Object
6 7 8 |
# File 'lib/geocoder/lookups/smarty_streets.rb', line 6 def name "SmartyStreets" end |
#query_url(query) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/geocoder/lookups/smarty_streets.rb', line 14 def query_url(query) if zipcode_only?(query) "#{protocol}://us-zipcode.api.smartystreets.com/lookup?#{url_query_string(query)}" else "#{protocol}://api.smartystreets.com/street-address?#{url_query_string(query)}" end end |
#required_api_key_parts ⇒ Object
10 11 12 |
# File 'lib/geocoder/lookups/smarty_streets.rb', line 10 def required_api_key_parts %w(auti-id auth-token) end |
#supported_protocols ⇒ Object
required by API as of 26 March 2015
23 24 25 |
# File 'lib/geocoder/lookups/smarty_streets.rb', line 23 def supported_protocols [:https] end |