Class: Test::Unit::MixColor
- Inherits:
-
Object
- Object
- Test::Unit::MixColor
- Defined in:
- lib/test/unit/color.rb
Instance Method Summary collapse
- #+(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.
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_sequence ⇒ Object
52 53 54 |
# File 'lib/test/unit/color.rb', line 52 def escape_sequence "\e[#{sequence.join(';')}m" end |
#sequence ⇒ Object
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 |