Class: Google::Geocoding::Geometry

Inherits:
Object
  • Object
show all
Defined in:
lib/google/geocoding.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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, viewport)
  @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 = viewport.map { |k, v| [k.to_sym, LatLng.new(v['lat'], v['lng'])] }.to_h
end

Instance Attribute Details

#boundsObject (readonly)

Returns the value of attribute bounds.



74
75
76
# File 'lib/google/geocoding.rb', line 74

def bounds
  @bounds
end

#locationObject (readonly)

Returns the value of attribute location.



74
75
76
# File 'lib/google/geocoding.rb', line 74

def location
  @location
end

#location_typeObject (readonly)

Returns the value of attribute location_type.



74
75
76
# File 'lib/google/geocoding.rb', line 74

def location_type
  @location_type
end

#viewportObject (readonly)

Returns the value of attribute viewport.



74
75
76
# File 'lib/google/geocoding.rb', line 74

def viewport
  @viewport
end