Class: Tiqbi::View::Cursor

Inherits:
Object
  • Object
show all
Defined in:
lib/tiqbi/view/cursor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCursor

Returns a new instance of Cursor.



8
9
10
11
# File 'lib/tiqbi/view/cursor.rb', line 8

def initialize
  @x = 0
  @y = 0
end

Instance Attribute Details

#xObject

Returns the value of attribute x.



6
7
8
# File 'lib/tiqbi/view/cursor.rb', line 6

def x
  @x
end

#yObject

Returns the value of attribute y.



6
7
8
# File 'lib/tiqbi/view/cursor.rb', line 6

def y
  @y
end

Instance Method Details

#clearObject



13
14
15
16
# File 'lib/tiqbi/view/cursor.rb', line 13

def clear
  self.x = 0
  self.y = 0
end

#downObject



22
23
24
# File 'lib/tiqbi/view/cursor.rb', line 22

def down
  self.y += 1
end

#leftObject



26
27
28
# File 'lib/tiqbi/view/cursor.rb', line 26

def left
  self.x -= 1
end

#rightObject



30
31
32
# File 'lib/tiqbi/view/cursor.rb', line 30

def right
  self.x += 1
end

#upObject



18
19
20
# File 'lib/tiqbi/view/cursor.rb', line 18

def up
  self.y -= 1
end