Class: SmartyStreets::USReverseGeo::Lookup

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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_hashObject

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

#latitudeObject

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

#longitudeObject

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

#responseObject

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

#sourceObject

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