Class: MetricAdapter::ReekAdapter
- Inherits:
-
Object
- Object
- MetricAdapter::ReekAdapter
- Defined in:
- lib/adapters/reek_adapter.rb
Instance Attribute Summary collapse
-
#examiner ⇒ Object
readonly
Returns the value of attribute examiner.
Instance Method Summary collapse
-
#initialize(examiner) ⇒ ReekAdapter
constructor
A new instance of ReekAdapter.
- #metrics ⇒ Object
Constructor Details
#initialize(examiner) ⇒ ReekAdapter
Returns a new instance of ReekAdapter.
5 6 7 |
# File 'lib/adapters/reek_adapter.rb', line 5 def initialize(examiner) @examiner = examiner end |
Instance Attribute Details
#examiner ⇒ Object (readonly)
Returns the value of attribute examiner.
3 4 5 |
# File 'lib/adapters/reek_adapter.rb', line 3 def examiner @examiner end |
Instance Method Details
#metrics ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/adapters/reek_adapter.rb', line 9 def metrics metrics = examiner.smells.map do |smell| line_numbers = Array(smell.lines).uniq line_numbers.map do |line| create_metric(smell, line) end end metrics.flatten end |