Class: GoogleGeocodings::Rectangle
- Inherits:
-
Object
- Object
- GoogleGeocodings::Rectangle
- Defined in:
- lib/google_geocodings/rectangle.rb
Instance Attribute Summary collapse
-
#format ⇒ Object
readonly
Returns the value of attribute format.
Instance Method Summary collapse
-
#initialize(bounds = {}) ⇒ Rectangle
constructor
A new instance of Rectangle.
Constructor Details
#initialize(bounds = {}) ⇒ Rectangle
Returns a new instance of Rectangle.
9 10 11 12 13 14 15 16 17 |
# File 'lib/google_geocodings/rectangle.rb', line 9 def initialize(bounds = {}) bounds ||= {} start_latitude = bounds[:start_latitude] start_longitude = bounds[:start_longitude] end_latitude = bounds[:end_latitude] end_longitude = bounds[:end_longitude] return unless start_latitude && start_longitude && end_latitude && end_longitude @format = [[("%.8f" % start_latitude), ("%.8f" % start_longitude)].join(','), [("%.8f" % end_latitude), ("%.8f" % end_longitude)].join(',')].join('|') end |
Instance Attribute Details
#format ⇒ Object (readonly)
Returns the value of attribute format.
3 4 5 |
# File 'lib/google_geocodings/rectangle.rb', line 3 def format @format end |