Class: SmartyStreets::USReverseGeo::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/smartystreets_ruby_sdk/us_reverse_geo/result.rb

Overview

A result is a possible match for an geocode that was submitted. A lookup can have multiple results.

See “smartystreets.com/docs/cloud/us-reverse-geo-api#result

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(obj) ⇒ Result

Returns a new instance of Result.



12
13
14
15
16
# File 'lib/smartystreets_ruby_sdk/us_reverse_geo/result.rb', line 12

def initialize(obj)
  @address = Address.new(obj.fetch('address', {}))
  @coordinate = Coordinate.new(obj.fetch('coordinate', {}))
  @distance = obj['distance']
end

Instance Attribute Details

#addressObject (readonly)

Returns the value of attribute address.



10
11
12
# File 'lib/smartystreets_ruby_sdk/us_reverse_geo/result.rb', line 10

def address
  @address
end

#coordinateObject (readonly)

Returns the value of attribute coordinate.



10
11
12
# File 'lib/smartystreets_ruby_sdk/us_reverse_geo/result.rb', line 10

def coordinate
  @coordinate
end

#distanceObject (readonly)

Returns the value of attribute distance.



10
11
12
# File 'lib/smartystreets_ruby_sdk/us_reverse_geo/result.rb', line 10

def distance
  @distance
end