Class: Test::Unit::MixColor

Inherits:
Object
  • Object
show all
Defined in:
lib/test/unit/color.rb

Instance Method Summary collapse

Constructor Details

#initialize(colors) ⇒ MixColor

Returns a new instance of MixColor.



42
43
44
# File 'lib/test/unit/color.rb', line 42

def initialize(colors)
  @colors = colors
end

Instance Method Details

#+(other) ⇒ Object



56
57
58
# File 'lib/test/unit/color.rb', line 56

def +(other)
  self.class.new([self, other])
end

#escape_sequenceObject



52
53
54
# File 'lib/test/unit/color.rb', line 52

def escape_sequence
  "\e[#{sequence.join(';')}m"
end

#sequenceObject



46
47
48
49
50
# File 'lib/test/unit/color.rb', line 46

def sequence
  @colors.inject([]) do |result, color|
    result + color.sequence
  end
end