Class: Megingiard::AnsiEscapeSequence
- Inherits:
-
Object
- Object
- Megingiard::AnsiEscapeSequence
- Defined in:
- lib/megingiard/ansi_escape_sequence.rb
Overview
As the name suggests
Instance Method Summary collapse
-
#initialize(code) ⇒ AnsiEscapeSequence
constructor
A new instance of AnsiEscapeSequence.
- #to_s ⇒ Object
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_s ⇒ Object
12 13 14 |
# File 'lib/megingiard/ansi_escape_sequence.rb', line 12 def to_s "\e[#{@code}m" end |