Class: SmartyStreets::USReverseGeo::Lookup
- Inherits:
-
Object
- Object
- SmartyStreets::USReverseGeo::Lookup
- Defined in:
- lib/smartystreets_ruby_sdk/us_reverse_geo/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.
Note: Lookups must have certain required fields set with non-blank values. These can be found at the URL below.
See “smartystreets.com/docs/cloud/us-reverse-geo-api#http-request-input-fields”
Instance Attribute Summary collapse
-
#custom_param_hash ⇒ Object
Returns the value of attribute custom_param_hash.
-
#latitude ⇒ Object
Returns the value of attribute latitude.
-
#longitude ⇒ Object
Returns the value of attribute longitude.
-
#response ⇒ Object
Returns the value of attribute response.
-
#source ⇒ Object
Returns the value of attribute source.
Instance Method Summary collapse
- #add_custom_parameter(parameter, value) ⇒ Object
-
#initialize(latitude, longitude, source = nil, custom_param_hash = nil) ⇒ Lookup
constructor
A new instance of Lookup.
Constructor Details
#initialize(latitude, longitude, source = nil, custom_param_hash = nil) ⇒ Lookup
Returns a new instance of Lookup.
15 16 17 18 19 20 |
# File 'lib/smartystreets_ruby_sdk/us_reverse_geo/lookup.rb', line 15 def initialize(latitude, longitude, source=nil, custom_param_hash=nil) @latitude = sprintf('%.8f', latitude) @longitude = sprintf('%.8f', longitude) @source = source @custom_param_hash = {} end |
Instance Attribute Details
#custom_param_hash ⇒ Object
Returns the value of attribute custom_param_hash.
13 14 15 |
# File 'lib/smartystreets_ruby_sdk/us_reverse_geo/lookup.rb', line 13 def custom_param_hash @custom_param_hash end |
#latitude ⇒ Object
Returns the value of attribute latitude.
13 14 15 |
# File 'lib/smartystreets_ruby_sdk/us_reverse_geo/lookup.rb', line 13 def latitude @latitude end |
#longitude ⇒ Object
Returns the value of attribute longitude.
13 14 15 |
# File 'lib/smartystreets_ruby_sdk/us_reverse_geo/lookup.rb', line 13 def longitude @longitude end |
#response ⇒ Object
Returns the value of attribute response.
13 14 15 |
# File 'lib/smartystreets_ruby_sdk/us_reverse_geo/lookup.rb', line 13 def response @response end |
#source ⇒ Object
Returns the value of attribute source.
13 14 15 |
# File 'lib/smartystreets_ruby_sdk/us_reverse_geo/lookup.rb', line 13 def source @source end |
Instance Method Details
#add_custom_parameter(parameter, value) ⇒ Object
22 23 24 |
# File 'lib/smartystreets_ruby_sdk/us_reverse_geo/lookup.rb', line 22 def add_custom_parameter(parameter, value) @custom_param_hash[parameter] = value end |