Class: HadoopDsl::LogAnalysis::LogAnalysisMapperModel::Topic

Inherits:
Object
  • Object
show all
Defined in:
lib/log_analysis.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(desc, label = nil) ⇒ Topic

Returns a new instance of Topic.



172
173
174
175
# File 'lib/log_analysis.rb', line 172

def initialize(desc, label = nil)
  @desc, @label = desc, label
  @key_elements = []
end

Instance Attribute Details

#key_elementsObject (readonly)

Returns the value of attribute key_elements.



170
171
172
# File 'lib/log_analysis.rb', line 170

def key_elements
  @key_elements
end

Instance Method Details

#keyObject



181
182
183
184
185
# File 'lib/log_analysis.rb', line 181

def key
  without_label =
    @key_elements.size > 0 ? @key_elements.join(KEY_SEP) : nil
  [label, without_label].compact.join(KEY_SEP)
end

#labelObject



177
178
179
# File 'lib/log_analysis.rb', line 177

def label
  @label || @desc.gsub(/\s/, '_')
end