Class: AbstractMarker

Inherits:
Object
  • Object
show all
Defined in:
lib/mapbox/abstract_marker.rb

Direct Known Subclasses

CustomMarker, MapboxMarker

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = nil) ⇒ AbstractMarker

Returns a new instance of AbstractMarker.



4
5
6
7
# File 'lib/mapbox/abstract_marker.rb', line 4

def initialize(args=nil)
  raise "Cannot directly instantiate a SimpleMarker" if self.class == AbstractMarker
  super
end

Instance Attribute Details

#latitudeObject

Returns the value of attribute latitude.



2
3
4
# File 'lib/mapbox/abstract_marker.rb', line 2

def latitude
  @latitude
end

#longitudeObject

Returns the value of attribute longitude.



2
3
4
# File 'lib/mapbox/abstract_marker.rb', line 2

def longitude
  @longitude
end

Instance Method Details

#latObject



9
10
11
# File 'lib/mapbox/abstract_marker.rb', line 9

def lat
  self.latitude
end

#lat=(latitude) ⇒ Object



17
18
19
# File 'lib/mapbox/abstract_marker.rb', line 17

def lat=(latitude)
  self.latitude = latitude
end

#lonObject



13
14
15
# File 'lib/mapbox/abstract_marker.rb', line 13

def lon
  self.longitude
end

#lon=(longitude) ⇒ Object



21
22
23
# File 'lib/mapbox/abstract_marker.rb', line 21

def lon=(longitude)
  self.longitude = longitude
end

#to_sObject



36
37
38
# File 'lib/mapbox/abstract_marker.rb', line 36

def to_s
  "(#{self.lon},#{self.lat})"
end