Class: PPCurses::Point

Inherits:
Object
  • Object
show all
Defined in:
lib/ppcurses/geometry.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

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



7
8
9
10
# File 'lib/ppcurses/geometry.rb', line 7

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

Instance Attribute Details

#xObject

Returns the value of attribute x.



5
6
7
# File 'lib/ppcurses/geometry.rb', line 5

def x
  @x
end

#yObject

Returns the value of attribute y.



5
6
7
# File 'lib/ppcurses/geometry.rb', line 5

def y
  @y
end

Class Method Details

.zeroPointObject



16
17
18
# File 'lib/ppcurses/geometry.rb', line 16

def Point.zeroPoint
  Point.new
end

Instance Method Details

#to_sObject



12
13
14
# File 'lib/ppcurses/geometry.rb', line 12

def to_s
  "x=#{@x} y=#{@y}"
end