Class: GooglePlaces::Rectangle
- Inherits:
-
Object
- Object
- GooglePlaces::Rectangle
- Defined in:
- lib/google_places/rectangle.rb
Instance Method Summary collapse
- #format ⇒ Object
-
#initialize(start_lat, start_lng, end_lat, end_lng) ⇒ Rectangle
constructor
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.
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
#format ⇒ Object
9 10 11 |
# File 'lib/google_places/rectangle.rb', line 9 def format [ @start_point.join(','), @end_point.join(',') ].join('|') end |