Class: Clusto::Point

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(x, y, tag = 0) ⇒ Point

Returns a new instance of Point.



5
6
7
8
9
# File 'lib/clusto/point.rb', line 5

def initialize(x, y, tag=0)
  @x = x
  @y = y
  @tag = tag
end

Instance Attribute Details

#tagObject

Returns the value of attribute tag.



3
4
5
# File 'lib/clusto/point.rb', line 3

def tag
  @tag
end

#xObject

Returns the value of attribute x.



3
4
5
# File 'lib/clusto/point.rb', line 3

def x
  @x
end

#yObject

Returns the value of attribute y.



3
4
5
# File 'lib/clusto/point.rb', line 3

def y
  @y
end

Instance Method Details

#to_sObject



11
12
13
# File 'lib/clusto/point.rb', line 11

def to_s
  return "(#{@x}, #{@y})"
end