class TTYString::Code::SlashB

Public Class Methods

match?(scanner) click to toggle source
# File lib/tty_string/code_definitions.rb, line 15
def self.match?(scanner)
  # can't use `scan(/\b/)` because it matches everything
  return false unless scanner.peek(1) == "\b"

  scanner.pos += 1
  true
end

Public Instance Methods

action() click to toggle source
# File lib/tty_string/code_definitions.rb, line 23
def action
  cursor.left
  screen.clear_at_cursor
end