Class: AdLint::Ld::VariableMapper
- Inherits:
-
Object
- Object
- AdLint::Ld::VariableMapper
- Defined in:
- lib/adlint/ld/object.rb
Instance Attribute Summary collapse
-
#map ⇒ Object
readonly
Returns the value of attribute map.
Instance Method Summary collapse
- #execute(met_fpath) ⇒ Object
-
#initialize ⇒ VariableMapper
constructor
A new instance of VariableMapper.
Constructor Details
#initialize ⇒ VariableMapper
144 145 146 |
# File 'lib/adlint/ld/object.rb', line 144 def initialize @map = VariableMap.new end |
Instance Attribute Details
#map ⇒ Object (readonly)
Returns the value of attribute map.
148 149 150 |
# File 'lib/adlint/ld/object.rb', line 148 def map @map end |
Instance Method Details
#execute(met_fpath) ⇒ Object
150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 |
# File 'lib/adlint/ld/object.rb', line 150 def execute(met_fpath) sma_wd = Pathname.pwd CSV.foreach(met_fpath) do |csv_row| rec = MetricRecord.of(csv_row, sma_wd) case when rec.version? sma_wd = Pathname.new(rec.exec_working_directory) when rec.variable_definition? if rec.variable_linkage_type == "X" @map.add_variable(Variable.new(rec)) end when rec.global_variable_declaration? @map.add_variable_declaration(VariableDeclaration.new(rec)) end end end |