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