Class: GooglePlaces::Rectangle

Inherits:
Object
  • Object
show all
Defined in:
lib/google_places/rectangle.rb

Instance Method Summary collapse

Constructor Details

#initialize(start_lat, start_lng, end_lat, end_lng) ⇒ Rectangle

The start_lat/lng pair values indicate the starting point of the rectangle The end_lat/lng pair values indicate the end point of the rectangle



5
6
7
# File 'lib/google_places/rectangle.rb', line 5

def initialize(start_lat, start_lng, end_lat, end_lng)
  @start_point, @end_point = [ ("%.8f"%start_lat), ("%.8f"%start_lng)], [("%.8f"%end_lat), ("%.8f"%end_lng) ]
end

Instance Method Details

#formatObject



9
10
11
# File 'lib/google_places/rectangle.rb', line 9

def format
  [ @start_point.join(','), @end_point.join(',') ].join('|')
end