Class: HadoopDsl::LogAnalysis::LogAnalysisMapperModel
- Inherits:
-
BaseMapperModel
- Object
- BaseModel
- BaseMapperModel
- HadoopDsl::LogAnalysis::LogAnalysisMapperModel
- Defined in:
- lib/log_analysis.rb
Overview
model
Defined Under Namespace
Classes: Column, ColumnArray, Topic
Instance Attribute Summary collapse
-
#current_topic ⇒ Object
readonly
Returns the value of attribute current_topic.
Attributes inherited from BaseMapperModel
Attributes inherited from BaseModel
Instance Method Summary collapse
- #column ⇒ Object
- #create_or_replace_columns_with(array, &block) ⇒ Object
- #create_topic(desc, options) ⇒ Object
-
#initialize(key, value) ⇒ LogAnalysisMapperModel
constructor
A new instance of LogAnalysisMapperModel.
Methods included from DslElement
Constructor Details
#initialize(key, value) ⇒ LogAnalysisMapperModel
Returns a new instance of LogAnalysisMapperModel.
129 130 131 132 133 |
# File 'lib/log_analysis.rb', line 129 def initialize(key, value) super(key, value) @columns = ColumnArray.new @topics = [] end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class HadoopDsl::DslElement
Instance Attribute Details
#current_topic ⇒ Object (readonly)
Returns the value of attribute current_topic.
127 128 129 |
# File 'lib/log_analysis.rb', line 127 def current_topic @current_topic end |
Instance Method Details
#column ⇒ Object
135 |
# File 'lib/log_analysis.rb', line 135 def column; @columns end |
#create_or_replace_columns_with(array, &block) ⇒ Object
141 142 143 144 145 146 147 148 |
# File 'lib/log_analysis.rb', line 141 def create_or_replace_columns_with(array, &block) columns = array.enum_for(:each_with_index).map do |p, i| c = @columns[i] ? @columns[i] : Column.new(i) yield c, p c end @columns = ColumnArray.new(columns) end |