Class: TTYString::CSICode

Inherits:
Code
  • Object
show all
Defined in:
lib/tty_string/csi_code.rb,
lib/tty_string/csi_code_definitions.rb

Direct Known Subclasses

A, B, C, D, E, F, G, H, J, K, LowH, LowM, S, T, Tilde, Unknown

Defined Under Namespace

Classes: A, B, C, D, E, F, G, H, J, K, LowF, LowH, LowL, LowM, S, T, Tilde, Unknown

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Code

#action, char, descendants, inherited, #initialize, render

Constructor Details

This class inherits a constructor from TTYString::Code

Class Method Details

.default_arg(value = nil) ⇒ Object



8
9
10
11
# File 'lib/tty_string/csi_code.rb', line 8

def default_arg(value = nil)
  @default_arg ||= value
  @default_arg || '0'
end

Instance Method Details

#integer(value) ⇒ Object



51
52
53
54
55
# File 'lib/tty_string/csi_code.rb', line 51

def integer(value)
  return value.to_i if value.match?(/\A\d+\z/)

  parser.unknown
end