Class: SmartyStreets::InternationalAutocomplete::Lookup

Inherits:
JSONAble
  • Object
show all
Defined in:
lib/smartystreets_ruby_sdk/international_autocomplete/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.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from JSONAble

#from_json!, #to_json

Constructor Details

#initialize(search = nil, address_id = nil, country = nil, max_results = nil, locality = nil, postal_code = nil, custom_param_hash = nil) ⇒ Lookup

Returns a new instance of Lookup.



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

def initialize(search = nil, address_id = nil, country = nil, max_results = nil, locality = nil, postal_code = nil, custom_param_hash = nil)
  @result = []
  @search = search
  @address_id = address_id
  @country = country
  @max_results = max_results
  @locality = locality
  @postal_code = postal_code
  @custom_param_hash = {}
end

Instance Attribute Details

#address_idObject

Returns the value of attribute address_id.



9
10
11
# File 'lib/smartystreets_ruby_sdk/international_autocomplete/lookup.rb', line 9

def address_id
  @address_id
end

#countryObject

Returns the value of attribute country.



9
10
11
# File 'lib/smartystreets_ruby_sdk/international_autocomplete/lookup.rb', line 9

def country
  @country
end

#custom_param_hashObject

Returns the value of attribute custom_param_hash.



9
10
11
# File 'lib/smartystreets_ruby_sdk/international_autocomplete/lookup.rb', line 9

def custom_param_hash
  @custom_param_hash
end

#localityObject

Returns the value of attribute locality.



9
10
11
# File 'lib/smartystreets_ruby_sdk/international_autocomplete/lookup.rb', line 9

def locality
  @locality
end

#max_resultsObject

Returns the value of attribute max_results.



9
10
11
# File 'lib/smartystreets_ruby_sdk/international_autocomplete/lookup.rb', line 9

def max_results
  @max_results
end

#postal_codeObject

Returns the value of attribute postal_code.



9
10
11
# File 'lib/smartystreets_ruby_sdk/international_autocomplete/lookup.rb', line 9

def postal_code
  @postal_code
end

#resultObject

Returns the value of attribute result.



9
10
11
# File 'lib/smartystreets_ruby_sdk/international_autocomplete/lookup.rb', line 9

def result
  @result
end

#searchObject

Returns the value of attribute search.



9
10
11
# File 'lib/smartystreets_ruby_sdk/international_autocomplete/lookup.rb', line 9

def search
  @search
end

Instance Method Details

#add_custom_parameter(parameter, value) ⇒ Object



22
23
24
# File 'lib/smartystreets_ruby_sdk/international_autocomplete/lookup.rb', line 22

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