Class: Google::Geocoding::Geometry
- Inherits:
-
Object
- Object
- Google::Geocoding::Geometry
- Defined in:
- lib/google/geocoding.rb
Instance Attribute Summary collapse
-
#bounds ⇒ Object
readonly
Returns the value of attribute bounds.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#location_type ⇒ Object
readonly
Returns the value of attribute location_type.
-
#viewport ⇒ Object
readonly
Returns the value of attribute viewport.
Instance Method Summary collapse
-
#initialize(bounds, location, location_type, viewport) ⇒ Geometry
constructor
A new instance of Geometry.
Constructor Details
#initialize(bounds, location, location_type, viewport) ⇒ Geometry
Returns a new instance of Geometry.
76 77 78 79 80 81 |
# File 'lib/google/geocoding.rb', line 76 def initialize(bounds, location, location_type, ) @bounds = bounds.map { |k, v| [k.to_sym, LatLng.new(v['lat'], v['lng'])] }.to_h @location = LatLng.new(location['lat'], location['lng']) @location_type = location_type @viewport = .map { |k, v| [k.to_sym, LatLng.new(v['lat'], v['lng'])] }.to_h end |
Instance Attribute Details
#bounds ⇒ Object (readonly)
Returns the value of attribute bounds.
74 75 76 |
# File 'lib/google/geocoding.rb', line 74 def bounds @bounds end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
74 75 76 |
# File 'lib/google/geocoding.rb', line 74 def location @location end |
#location_type ⇒ Object (readonly)
Returns the value of attribute location_type.
74 75 76 |
# File 'lib/google/geocoding.rb', line 74 def location_type @location_type end |
#viewport ⇒ Object (readonly)
Returns the value of attribute viewport.
74 75 76 |
# File 'lib/google/geocoding.rb', line 74 def @viewport end |