Class: GoogleMap::Point

Inherits:
Object
  • Object
show all
Defined in:
lib/google_map/point.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#latObject

Returns the value of attribute lat.



4
5
6
# File 'lib/google_map/point.rb', line 4

def lat
  @lat
end

#lngObject

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_jsObject



16
17
18
# File 'lib/google_map/point.rb', line 16

def to_js   
  return "new GLatLng(#{self.lat}, #{self.lng})"  	
end