Class: SmartyStreets::USZipcode::Lookup

Inherits:
JSONAble
  • Object
show all
Defined in:
lib/smartystreets_ruby_sdk/us_zipcode/lookup.rb

Overview

In addition to holding all of the input data for this lookup, this class also

will contain the result of the lookup after it comes back from the API.

See "https://smartystreets.com/docs/cloud/us-zipcode-api#http-request-input-fields"

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from JSONAble

#from_json!, #to_json

Constructor Details

#initialize(city = nil, state = nil, zipcode = nil, input_id = nil, custom_param_hash = nil) ⇒ Lookup

Returns a new instance of Lookup.



12
13
14
15
16
17
18
19
# File 'lib/smartystreets_ruby_sdk/us_zipcode/lookup.rb', line 12

def initialize(city=nil, state=nil, zipcode=nil, input_id=nil, custom_param_hash=nil)
  @result = nil
  @input_id = input_id
  @city = city
  @state = state
  @zipcode = zipcode
  @custom_param_hash = {}
end

Instance Attribute Details

#cityObject

Returns the value of attribute city.



10
11
12
# File 'lib/smartystreets_ruby_sdk/us_zipcode/lookup.rb', line 10

def city
  @city
end

#custom_param_hashObject

Returns the value of attribute custom_param_hash.



10
11
12
# File 'lib/smartystreets_ruby_sdk/us_zipcode/lookup.rb', line 10

def custom_param_hash
  @custom_param_hash
end

#input_idObject

Returns the value of attribute input_id.



10
11
12
# File 'lib/smartystreets_ruby_sdk/us_zipcode/lookup.rb', line 10

def input_id
  @input_id
end

#resultObject

Returns the value of attribute result.



10
11
12
# File 'lib/smartystreets_ruby_sdk/us_zipcode/lookup.rb', line 10

def result
  @result
end

#stateObject

Returns the value of attribute state.



10
11
12
# File 'lib/smartystreets_ruby_sdk/us_zipcode/lookup.rb', line 10

def state
  @state
end

#zipcodeObject

Returns the value of attribute zipcode.



10
11
12
# File 'lib/smartystreets_ruby_sdk/us_zipcode/lookup.rb', line 10

def zipcode
  @zipcode
end

Instance Method Details

#add_custom_parameter(parameter, value) ⇒ Object



21
22
23
# File 'lib/smartystreets_ruby_sdk/us_zipcode/lookup.rb', line 21

def add_custom_parameter(parameter, value)
  @custom_param_hash[parameter] = value
end