Method: IO.backward

Defined in:
lib/term/cursor.rb

.backward(num = 1) ⇒ Term

moves the cursor backward by num columns.

Parameters:

  • num (Integer) (defaults to: 1)

    the columns, the default num is 1.

Returns:

  • (Term)

    Term self.



101
102
103
104
# File 'lib/term/cursor.rb', line 101

def self.backward(num = 1)
  print "\e[#{num}D" # CUB
  self
end