Class: Test::MixColor
- Inherits:
-
Object
- Object
- Test::MixColor
- Defined in:
- lib/test-unit-ext/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.
41 42 43 |
# File 'lib/test-unit-ext/color.rb', line 41 def initialize(colors) @colors = colors end |
Instance Method Details
#+(other) ⇒ Object
55 56 57 |
# File 'lib/test-unit-ext/color.rb', line 55 def +(other) self.class.new([self, other]) end |
#escape_sequence ⇒ Object
51 52 53 |
# File 'lib/test-unit-ext/color.rb', line 51 def escape_sequence "\e[#{sequence.join(';')}m" end |
#sequence ⇒ Object
45 46 47 48 49 |
# File 'lib/test-unit-ext/color.rb', line 45 def sequence @colors.inject([]) do |result, color| result + color.sequence end end |