class TerminalNotes::Cursor
Attributes
x[R]
y[R]
Public Class Methods
new(x: 0, y: 0)
click to toggle source
# File lib/terminal-notes/cursor.rb, line 5 def initialize(x: 0, y: 0) @x = x.to_i @y = y.to_i end
Public Instance Methods
moveBy(deltaX = 0, deltaY = 0)
click to toggle source
# File lib/terminal-notes/cursor.rb, line 10 def moveBy(deltaX = 0, deltaY = 0) @x += deltaX @y += deltaY self end
moveTo(x: nil, y: nil)
click to toggle source
# File lib/terminal-notes/cursor.rb, line 16 def moveTo(x: nil, y: nil) @x = x unless x.nil? @y = y unless y.nil? self end
to_hash()
click to toggle source
# File lib/terminal-notes/cursor.rb, line 22 def to_hash { x: @x, y: @y } end