Class: GoogleGeocodeApi::Address

Inherits:
Object
  • Object
show all
Defined in:
lib/google_geocode_api/address.rb

Overview

Address object

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(obj) ⇒ Address

Returns a new instance of Address.



8
9
10
11
12
13
14
# File 'lib/google_geocode_api/address.rb', line 8

def initialize(obj)
  @formatted_address = obj.formatted_address
  @place_id = obj.place_id
  @latitude = obj.geometry.location.lat
  @longitude = obj.geometry.location.lng
  @location_type = obj.geometry.location_type
end

Instance Attribute Details

#formatted_addressObject (readonly)

Returns the value of attribute formatted_address.



6
7
8
# File 'lib/google_geocode_api/address.rb', line 6

def formatted_address
  @formatted_address
end

#latitudeObject (readonly)

Returns the value of attribute latitude.



6
7
8
# File 'lib/google_geocode_api/address.rb', line 6

def latitude
  @latitude
end

#location_typeObject (readonly)

Returns the value of attribute location_type.



6
7
8
# File 'lib/google_geocode_api/address.rb', line 6

def location_type
  @location_type
end

#longitudeObject (readonly)

Returns the value of attribute longitude.



6
7
8
# File 'lib/google_geocode_api/address.rb', line 6

def longitude
  @longitude
end

#place_idObject (readonly)

Returns the value of attribute place_id.



6
7
8
# File 'lib/google_geocode_api/address.rb', line 6

def place_id
  @place_id
end