Class: Tiqbi::View::Cursor
- Inherits:
-
Object
- Object
- Tiqbi::View::Cursor
- Defined in:
- lib/tiqbi/view/cursor.rb
Instance Attribute Summary collapse
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
Instance Method Summary collapse
- #clear ⇒ Object
- #down ⇒ Object
-
#initialize ⇒ Cursor
constructor
A new instance of Cursor.
- #left ⇒ Object
- #right ⇒ Object
- #up ⇒ Object
Constructor Details
#initialize ⇒ Cursor
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
#x ⇒ Object
Returns the value of attribute x.
6 7 8 |
# File 'lib/tiqbi/view/cursor.rb', line 6 def x @x end |
#y ⇒ Object
Returns the value of attribute y.
6 7 8 |
# File 'lib/tiqbi/view/cursor.rb', line 6 def y @y end |
Instance Method Details
#clear ⇒ Object
13 14 15 16 |
# File 'lib/tiqbi/view/cursor.rb', line 13 def clear self.x = 0 self.y = 0 end |
#down ⇒ Object
22 23 24 |
# File 'lib/tiqbi/view/cursor.rb', line 22 def down self.y += 1 end |
#left ⇒ Object
26 27 28 |
# File 'lib/tiqbi/view/cursor.rb', line 26 def left self.x -= 1 end |
#right ⇒ Object
30 31 32 |
# File 'lib/tiqbi/view/cursor.rb', line 30 def right self.x += 1 end |
#up ⇒ Object
18 19 20 |
# File 'lib/tiqbi/view/cursor.rb', line 18 def up self.y -= 1 end |