Class: AnsiColor::Effects

Inherits:
Array
  • Object
show all
Defined in:
lib/ansi_color/effects.rb

Instance Method Summary collapse

Constructor Details

#initialize(array) ⇒ Effects

Returns a new instance of Effects.



3
4
5
6
7
# File 'lib/ansi_color/effects.rb', line 3

def initialize(array)
  # This should probably be validated
  valid_effects = array.select { |effect| EFFECTS.include?(effect) }
  super(valid_effects)
end

Instance Method Details

#to_codes!Object



8
9
10
# File 'lib/ansi_color/effects.rb', line 8

def to_codes!
  self.map! { |code| EFFECTS[code] }.join(';')
end