123456789_123456789_123456789_123456789_123456789_

Class: Test::Unit::MixColor

Relationships & Source Files
Inherits: Object
Defined in: lib/test/unit/color.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(colors) ⇒ MixColor

[ GitHub ]

  
# File 'lib/test/unit/color.rb', line 111

def initialize(colors)
  @colors = colors
end

Instance Attribute Details

#colors (readonly)

[ GitHub ]

  
# File 'lib/test/unit/color.rb', line 110

attr_reader :colors

Instance Method Details

#+(other)

[ GitHub ]

  
# File 'lib/test/unit/color.rb', line 125

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

#==(other)

[ GitHub ]

  
# File 'lib/test/unit/color.rb', line 129

def ==(other)
  self.class === other and colors == other.colors
end

#escape_sequence

[ GitHub ]

  
# File 'lib/test/unit/color.rb', line 121

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

#sequence

[ GitHub ]

  
# File 'lib/test/unit/color.rb', line 115

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