Class: Kluster::Cluster
- Inherits:
-
Object
- Object
- Kluster::Cluster
- Includes:
- Geocoder::Calculations
- Defined in:
- lib/kluster/cluster.rb
Instance Attribute Summary collapse
-
#latitude ⇒ Object
Returns the value of attribute latitude.
-
#longitude ⇒ Object
Returns the value of attribute longitude.
-
#pins ⇒ Object
Returns the value of attribute pins.
Instance Method Summary collapse
- #coordinate ⇒ Object
-
#initialize(initial_pin = nil) ⇒ Cluster
constructor
A new instance of Cluster.
- #ll ⇒ Object
- #number_of_pins ⇒ Object
Constructor Details
#initialize(initial_pin = nil) ⇒ Cluster
Returns a new instance of Cluster.
6 7 8 9 |
# File 'lib/kluster/cluster.rb', line 6 def initialize(initial_pin=nil) @pins = [initial_pin] @number_of_pins = 1 end |
Instance Attribute Details
#latitude ⇒ Object
Returns the value of attribute latitude.
4 5 6 |
# File 'lib/kluster/cluster.rb', line 4 def latitude @latitude end |
#longitude ⇒ Object
Returns the value of attribute longitude.
4 5 6 |
# File 'lib/kluster/cluster.rb', line 4 def longitude @longitude end |
#pins ⇒ Object
Returns the value of attribute pins.
4 5 6 |
# File 'lib/kluster/cluster.rb', line 4 def pins @pins end |
Instance Method Details
#coordinate ⇒ Object
11 12 13 |
# File 'lib/kluster/cluster.rb', line 11 def coordinate [latitude, longitude] end |
#ll ⇒ Object
15 16 17 |
# File 'lib/kluster/cluster.rb', line 15 def ll "#{latitude},#{longitude}" end |
#number_of_pins ⇒ Object
27 28 29 |
# File 'lib/kluster/cluster.rb', line 27 def number_of_pins @pins.count end |