Class: Test::Unit::MixColor
- Inherits:
-
Object
- Object
- Test::Unit::MixColor
- Defined in:
- lib/test/unit/color.rb
Instance Attribute Summary collapse
-
#colors ⇒ Object
readonly
Returns the value of attribute colors.
Instance Method Summary collapse
- #+(other) ⇒ Object
- #==(other) ⇒ Object
- #escape_sequence ⇒ Object
-
#initialize(colors) ⇒ MixColor
constructor
A new instance of MixColor.
- #sequence ⇒ Object
Constructor Details
#initialize(colors) ⇒ MixColor
Returns a new instance of MixColor.
73 74 75 |
# File 'lib/test/unit/color.rb', line 73 def initialize(colors) @colors = colors end |
Instance Attribute Details
#colors ⇒ Object (readonly)
Returns the value of attribute colors.
72 73 74 |
# File 'lib/test/unit/color.rb', line 72 def colors @colors end |
Instance Method Details
#+(other) ⇒ Object
87 88 89 |
# File 'lib/test/unit/color.rb', line 87 def +(other) self.class.new([self, other]) end |
#==(other) ⇒ Object
91 92 93 |
# File 'lib/test/unit/color.rb', line 91 def ==(other) self.class === other and colors == other.colors end |
#escape_sequence ⇒ Object
83 84 85 |
# File 'lib/test/unit/color.rb', line 83 def escape_sequence "\e[#{sequence.join(';')}m" end |
#sequence ⇒ Object
77 78 79 80 81 |
# File 'lib/test/unit/color.rb', line 77 def sequence @colors.inject([]) do |result, color| result + color.sequence end end |