Class: BenchmarkResult
- Inherits:
-
Object
- Object
- BenchmarkResult
- Defined in:
- lib/audit/lib/benchmark/benchmark_result.rb
Overview
To change this template, choose Tools | Templates and open the template in the editor.
Instance Attribute Summary collapse
-
#audit ⇒ Object
readonly
Returns the value of attribute audit.
Instance Method Summary collapse
- #add(rule_result) ⇒ Object
- #get(id) ⇒ Object
- #get_root ⇒ Object
-
#initialize(audit) ⇒ BenchmarkResult
constructor
A new instance of BenchmarkResult.
Constructor Details
#initialize(audit) ⇒ BenchmarkResult
Returns a new instance of BenchmarkResult.
7 8 9 10 |
# File 'lib/audit/lib/benchmark/benchmark_result.rb', line 7 def initialize(audit) @audit = audit @document = {} end |
Instance Attribute Details
#audit ⇒ Object (readonly)
Returns the value of attribute audit.
5 6 7 |
# File 'lib/audit/lib/benchmark/benchmark_result.rb', line 5 def audit @audit end |
Instance Method Details
#add(rule_result) ⇒ Object
12 13 14 |
# File 'lib/audit/lib/benchmark/benchmark_result.rb', line 12 def add(rule_result) @document[rule_result.rule.id] = rule_result end |
#get(id) ⇒ Object
16 17 18 19 20 |
# File 'lib/audit/lib/benchmark/benchmark_result.rb', line 16 def get(id) return @benchmark if id == :root || id == 'BENCHMARK' return @document[id] || @benchmark.get_item(id) end |
#get_root ⇒ Object
22 23 24 |
# File 'lib/audit/lib/benchmark/benchmark_result.rb', line 22 def get_root() return get(:root) end |