Class: TTYString::CSICode::K

Inherits:
TTYString::CSICode show all
Defined in:
lib/tty_string/csi_code_definitions.rb

Overview

leftovers:allow

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from TTYString::CSICode

default_arg

Methods inherited from TTYString::Code

char, descendants, inherited, #initialize, render

Constructor Details

This class inherits a constructor from TTYString::Code

Class Method Details

.arg_reObject



89
90
91
# File 'lib/tty_string/csi_code_definitions.rb', line 89

def self.arg_re
  /[0-2]?/
end

Instance Method Details

#action(mode = 0) ⇒ Object



93
94
95
96
97
98
99
100
101
# File 'lib/tty_string/csi_code_definitions.rb', line 93

def action(mode = 0)
  # :nocov: else won't ever be called. don't worry about it
  case mode
  # :nocov:
  when 0 then screen.clear_line_forward
  when 1 then screen.clear_line_backward
  when 2 then screen.clear_line
  end
end