Class: Megingiard::AnsiEscapeSequence

Inherits:
Object
  • Object
show all
Defined in:
lib/megingiard/ansi_escape_sequence.rb

Overview

As the name suggests

Instance Method Summary collapse

Constructor Details

#initialize(code) ⇒ AnsiEscapeSequence

Returns a new instance of AnsiEscapeSequence.



7
8
9
10
# File 'lib/megingiard/ansi_escape_sequence.rb', line 7

def initialize(code)
  AnsiEscapeCodeValidator.instance.validate(code)
  @code = code
end

Instance Method Details

#to_sObject



12
13
14
# File 'lib/megingiard/ansi_escape_sequence.rb', line 12

def to_s
  "\e[#{@code}m"
end