Class: SmartyStreetsApi::ApiClient

Inherits:
Object
  • Object
show all
Defined in:
lib/smartystreets_api/api_client.rb

Direct Known Subclasses

InternationalStreetAddress, UsStreetAddress

Class Method Summary collapse

Class Method Details

.get_single(options) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/smartystreets_api/api_client.rb', line 2

def self.get_single(options)
  uri = URI(endpoint)

  args = options.select do |name, value|
    whitelisted_input_fields.include?(name.to_s)
  end.merge!(auth_args)

  uri.query = URI.encode_www_form(args)

  response = Net::HTTP.get_response(uri)

  raise_error!(response.code) if severe_error?(response.code)

  parse(response)
end