Class: Megingiard::AnsiEscapeCodeValidator

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/megingiard/ansi_escape_code_validator.rb

Overview

Validator for ANSI escape sequence

Constant Summary collapse

VALID_ESCAPE_CODES =
0..55

Instance Method Summary collapse

Instance Method Details

#validate(code) ⇒ Object

Validate an ANSI escape sequence



16
17
18
# File 'lib/megingiard/ansi_escape_code_validator.rb', line 16

def validate(code)
  fail InvalidAnsiEscapeCode unless VALID_ESCAPE_CODES.include?(code)
end