Class: Clusto::Point
- Inherits:
-
Object
- Object
- Clusto::Point
- Defined in:
- lib/clusto/point.rb
Instance Attribute Summary collapse
-
#tag ⇒ Object
Returns the value of attribute tag.
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
Instance Method Summary collapse
-
#initialize(x, y, tag = 0) ⇒ Point
constructor
A new instance of Point.
- #to_s ⇒ Object
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
#tag ⇒ Object
Returns the value of attribute tag.
3 4 5 |
# File 'lib/clusto/point.rb', line 3 def tag @tag end |
#x ⇒ Object
Returns the value of attribute x.
3 4 5 |
# File 'lib/clusto/point.rb', line 3 def x @x end |
#y ⇒ Object
Returns the value of attribute y.
3 4 5 |
# File 'lib/clusto/point.rb', line 3 def y @y end |
Instance Method Details
#to_s ⇒ Object
11 12 13 |
# File 'lib/clusto/point.rb', line 11 def to_s return "(#{@x}, #{@y})" end |