Class: DbClustering::Models::Cluster

Inherits:
Object
  • Object
show all
Defined in:
lib/models/cluster.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCluster

Returns a new instance of Cluster.



7
8
9
# File 'lib/models/cluster.rb', line 7

def initialize
  @points = []
end

Instance Attribute Details

#pointsObject

Returns the value of attribute points.



5
6
7
# File 'lib/models/cluster.rb', line 5

def points
  @points
end

Instance Method Details

#add(point) ⇒ Object



11
12
13
14
# File 'lib/models/cluster.rb', line 11

def add(point)
  @points << point
  point.cluster = self
end