Class: Point

Inherits:
AbstractPoint show all
Includes:
Foo, Show
Defined in:
lib/point.rb

Constant Summary

Constants inherited from AbstractPoint

AbstractPoint::ENV

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Show

add, #show, #time

Methods included from Foo

#show

Methods inherited from AbstractPoint

addone, #group

Methods inherited from BasePoint

#base_group, minusone

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

.hackObject



79
80
81
# File 'lib/point.rb', line 79

def Point.hack
    p 'hack from the outside of class Point'
end

.hackxObject



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_sObject



67
68
69
# File 'lib/point.rb', line 67

def to_s
    "[#{@x},#{@y}] - #{@@id} - #{@@base_id}"
end