Class: GoogleMap::Point
- Inherits:
-
Object
- Object
- GoogleMap::Point
- Defined in:
- lib/google_map/point.rb
Instance Attribute Summary collapse
-
#lat ⇒ Object
Returns the value of attribute lat.
-
#lng ⇒ Object
Returns the value of attribute lng.
Instance Method Summary collapse
-
#initialize(lat, lng) ⇒ Point
constructor
A new instance of Point.
- #to_js ⇒ Object
Constructor Details
#initialize(lat, lng) ⇒ Point
Returns a new instance of Point.
7 8 9 10 11 12 13 14 |
# File 'lib/google_map/point.rb', line 7 def initialize(lat, lng) self.lat = lat self.lng = lng if lat.blank? or lng.blank? raise "Must set lat, lng for GoogleMap::Point." end end |
Instance Attribute Details
#lat ⇒ Object
Returns the value of attribute lat.
4 5 6 |
# File 'lib/google_map/point.rb', line 4 def lat @lat end |
#lng ⇒ Object
Returns the value of attribute lng.
4 5 6 |
# File 'lib/google_map/point.rb', line 4 def lng @lng end |
Instance Method Details
#to_js ⇒ Object
16 17 18 |
# File 'lib/google_map/point.rb', line 16 def to_js return "new GLatLng(#{self.lat}, #{self.lng})" end |