Class: Echoes::Cursor

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(row: 0, col: 0) ⇒ Cursor

Returns a new instance of Cursor.



7
8
9
10
11
# File 'lib/echoes/cursor.rb', line 7

def initialize(row: 0, col: 0)
  @row = row
  @col = col
  @visible = true
end

Instance Attribute Details

#colObject

Returns the value of attribute col.



5
6
7
# File 'lib/echoes/cursor.rb', line 5

def col
  @col
end

#rowObject

Returns the value of attribute row.



5
6
7
# File 'lib/echoes/cursor.rb', line 5

def row
  @row
end

#visibleObject

Returns the value of attribute visible.



5
6
7
# File 'lib/echoes/cursor.rb', line 5

def visible
  @visible
end

Instance Method Details

#move_to(row, col) ⇒ Object



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

def move_to(row, col)
  @row = row
  @col = col
end