Class: GroongaQueryLog::Command::Analyzer::ConsoleReporter::MixColor
- Inherits:
-
Object
- Object
- GroongaQueryLog::Command::Analyzer::ConsoleReporter::MixColor
- Defined in:
- lib/groonga-query-log/command/analyzer/reporter/console.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.
102 103 104 |
# File 'lib/groonga-query-log/command/analyzer/reporter/console.rb', line 102 def initialize(colors) @colors = colors end |
Instance Attribute Details
#colors ⇒ Object (readonly)
Returns the value of attribute colors.
101 102 103 |
# File 'lib/groonga-query-log/command/analyzer/reporter/console.rb', line 101 def colors @colors end |
Instance Method Details
#+(other) ⇒ Object
116 117 118 |
# File 'lib/groonga-query-log/command/analyzer/reporter/console.rb', line 116 def +(other) self.class.new([self, other]) end |
#==(other) ⇒ Object
120 121 122 |
# File 'lib/groonga-query-log/command/analyzer/reporter/console.rb', line 120 def ==(other) self.class === other and colors == other.colors end |
#escape_sequence ⇒ Object
112 113 114 |
# File 'lib/groonga-query-log/command/analyzer/reporter/console.rb', line 112 def escape_sequence "\e[#{sequence.join(';')}m" end |
#sequence ⇒ Object
106 107 108 109 110 |
# File 'lib/groonga-query-log/command/analyzer/reporter/console.rb', line 106 def sequence @colors.inject([]) do |result, color| result + color.sequence end end |