Class: GoogleGeocodings::Geocoding
- Inherits:
-
Object
- Object
- GoogleGeocodings::Geocoding
- Defined in:
- lib/google_geocodings/geocoding.rb
Instance Attribute Summary collapse
-
#address_components ⇒ Object
readonly
Returns the value of attribute address_components.
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#formatted_address ⇒ Object
readonly
Returns the value of attribute formatted_address.
-
#geometry ⇒ Object
readonly
Returns the value of attribute geometry.
-
#place_id ⇒ Object
readonly
Returns the value of attribute place_id.
-
#types ⇒ Object
readonly
Returns the value of attribute types.
Instance Method Summary collapse
- #[](key) ⇒ Object
-
#initialize(json_result_object, api_key) ⇒ Geocoding
constructor
A new instance of Geocoding.
Constructor Details
#initialize(json_result_object, api_key) ⇒ Geocoding
Returns a new instance of Geocoding.
4 5 6 7 8 9 10 11 |
# File 'lib/google_geocodings/geocoding.rb', line 4 def initialize(json_result_object, api_key) @address_components = json_result_object['address_components'] @formatted_address = json_result_object['formatted_address'] @geometry = json_result_object['geometry'] @place_id = json_result_object['place_id'] @types = json_result_object['types'] @api_key = api_key end |
Instance Attribute Details
#address_components ⇒ Object (readonly)
Returns the value of attribute address_components.
3 4 5 |
# File 'lib/google_geocodings/geocoding.rb', line 3 def address_components @address_components end |
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
3 4 5 |
# File 'lib/google_geocodings/geocoding.rb', line 3 def api_key @api_key end |
#formatted_address ⇒ Object (readonly)
Returns the value of attribute formatted_address.
3 4 5 |
# File 'lib/google_geocodings/geocoding.rb', line 3 def formatted_address @formatted_address end |
#geometry ⇒ Object (readonly)
Returns the value of attribute geometry.
3 4 5 |
# File 'lib/google_geocodings/geocoding.rb', line 3 def geometry @geometry end |
#place_id ⇒ Object (readonly)
Returns the value of attribute place_id.
3 4 5 |
# File 'lib/google_geocodings/geocoding.rb', line 3 def place_id @place_id end |
#types ⇒ Object (readonly)
Returns the value of attribute types.
3 4 5 |
# File 'lib/google_geocodings/geocoding.rb', line 3 def types @types end |
Instance Method Details
#[](key) ⇒ Object
13 14 15 |
# File 'lib/google_geocodings/geocoding.rb', line 13 def [] (key) send(key) end |