class AbstractMarker

Attributes

latitude[RW]
longitude[RW]

Public Class Methods

new(args=nil) click to toggle source
Calls superclass method
# File lib/mapbox/abstract_marker.rb, line 4
def initialize(args=nil)
  raise "Cannot directly instantiate a SimpleMarker" if self.class == AbstractMarker
  super
end

Public Instance Methods

lat() click to toggle source
# File lib/mapbox/abstract_marker.rb, line 9
def lat
  self.latitude
end
lat=(latitude) click to toggle source
# File lib/mapbox/abstract_marker.rb, line 17
def lat=(latitude)
  self.latitude = latitude
end
latitude=(latitude) click to toggle source

Override the setting methods so that they validate the input and return a meaningful error message

# File lib/mapbox/abstract_marker.rb, line 28
def latitude=(latitude)
  @latitude = MapboxUtils.validate_latitude(latitude)
end
lon() click to toggle source
# File lib/mapbox/abstract_marker.rb, line 13
def lon
  self.longitude
end
lon=(longitude) click to toggle source
# File lib/mapbox/abstract_marker.rb, line 21
def lon=(longitude)
  self.longitude = longitude
end
longitude=(longitude) click to toggle source
# File lib/mapbox/abstract_marker.rb, line 32
def longitude=(longitude)
  @longitude = MapboxUtils.validate_longitude(longitude)
end
to_s() click to toggle source
# File lib/mapbox/abstract_marker.rb, line 36
def to_s
  "(#{self.lon},#{self.lat})"
end