Class: Groonga::QueryLog::Analyzer::ConsoleReporter::MixColor

Inherits:
Object
  • Object
show all
Defined in:
lib/groonga/query-log/analyzer/reporter/console.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(colors) ⇒ MixColor

Returns a new instance of MixColor.



96
97
98
# File 'lib/groonga/query-log/analyzer/reporter/console.rb', line 96

def initialize(colors)
  @colors = colors
end

Instance Attribute Details

#colorsObject (readonly)

Returns the value of attribute colors.



95
96
97
# File 'lib/groonga/query-log/analyzer/reporter/console.rb', line 95

def colors
  @colors
end

Instance Method Details

#+(other) ⇒ Object



110
111
112
# File 'lib/groonga/query-log/analyzer/reporter/console.rb', line 110

def +(other)
  self.class.new([self, other])
end

#==(other) ⇒ Object



114
115
116
# File 'lib/groonga/query-log/analyzer/reporter/console.rb', line 114

def ==(other)
  self.class === other and colors == other.colors
end

#escape_sequenceObject



106
107
108
# File 'lib/groonga/query-log/analyzer/reporter/console.rb', line 106

def escape_sequence
  "\e[#{sequence.join(';')}m"
end

#sequenceObject



100
101
102
103
104
# File 'lib/groonga/query-log/analyzer/reporter/console.rb', line 100

def sequence
  @colors.inject([]) do |result, color|
    result + color.sequence
  end
end