Class: MetricAdapter::FlogAdapter

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(flog) ⇒ FlogAdapter

Returns a new instance of FlogAdapter.



5
6
7
# File 'lib/adapters/flog_adapter.rb', line 5

def initialize(flog)
  @flog = flog
end

Instance Attribute Details

#flogObject (readonly)

Returns the value of attribute flog.



3
4
5
# File 'lib/adapters/flog_adapter.rb', line 3

def flog
  @flog
end

Instance Method Details

#metricsObject



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/adapters/flog_adapter.rb', line 9

def metrics
  metrics = []
  
  flog.each_by_score do |signature, score|
    if locatable?(signature)
      metrics << create_metric(signature, score)
    end
  end
  
  metrics
end