Class: Megingiard::TextColorSequence
- Inherits:
-
Object
- Object
- Megingiard::TextColorSequence
- Defined in:
- lib/megingiard/text_color_sequence.rb
Overview
ANSI Escape Sequence for a Text Color
Instance Method Summary collapse
-
#initialize(name) ⇒ TextColorSequence
constructor
A new instance of TextColorSequence.
- #to_s ⇒ Object
Constructor Details
#initialize(name) ⇒ TextColorSequence
Returns a new instance of TextColorSequence.
8 9 10 11 |
# File 'lib/megingiard/text_color_sequence.rb', line 8 def initialize(name) color_code = ANSI_COLORS.fetch(name) @escape_sequence = AnsiEscapeSequence.new(color_code + 30) end |
Instance Method Details
#to_s ⇒ Object
13 14 15 |
# File 'lib/megingiard/text_color_sequence.rb', line 13 def to_s @escape_sequence.to_s end |