Class: Point
- Inherits:
-
AbstractPoint
- Object
- BasePoint
- AbstractPoint
- Point
- Defined in:
- lib/point.rb
Constant Summary
Constants inherited from AbstractPoint
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(x = 0, y = 0) ⇒ Point
constructor
A new instance of Point.
- #to_s ⇒ Object
Methods included from Show
Methods included from Foo
Methods inherited from AbstractPoint
Methods inherited from BasePoint
Constructor Details
#initialize(x = 0, y = 0) ⇒ Point
Returns a new instance of Point.
57 58 59 |
# File 'lib/point.rb', line 57 def initialize(x=0, y=0) @x, @y = x, y end |
Class Method Details
.hack ⇒ Object
79 80 81 |
# File 'lib/point.rb', line 79 def Point.hack p 'hack from the outside of class Point' end |
.hackx ⇒ Object
74 75 76 |
# File 'lib/point.rb', line 74 def hackx p 'hack x' end |
.hello(name = 'world') ⇒ Object
62 63 64 |
# File 'lib/point.rb', line 62 def hello(name='world') p "hello #{name}" end |
Instance Method Details
#to_s ⇒ Object
67 68 69 |
# File 'lib/point.rb', line 67 def to_s "[#{@x},#{@y}] - #{@@id} - #{@@base_id}" end |