Class: MetricFu::FlayGrapher
- Inherits:
-
Grapher
- Object
- Grapher
- MetricFu::FlayGrapher
show all
- Defined in:
- lib/metric_fu/metrics/flay/grapher.rb
Instance Attribute Summary collapse
Attributes inherited from Grapher
#output_directory
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Grapher
#date, get_grapher, #graph!, graphers
Constructor Details
Returns a new instance of FlayGrapher.
10
11
12
13
14
|
# File 'lib/metric_fu/metrics/flay/grapher.rb', line 10
def initialize
super
@flay_score = []
@labels = {}
end
|
Instance Attribute Details
#flay_score ⇒ Object
Returns the value of attribute flay_score.
4
5
6
|
# File 'lib/metric_fu/metrics/flay/grapher.rb', line 4
def flay_score
@flay_score
end
|
#labels ⇒ Object
Returns the value of attribute labels.
4
5
6
|
# File 'lib/metric_fu/metrics/flay/grapher.rb', line 4
def labels
@labels
end
|
Class Method Details
.metric ⇒ Object
6
7
8
|
# File 'lib/metric_fu/metrics/flay/grapher.rb', line 6
def self.metric
:flay
end
|
Instance Method Details
#data ⇒ Object
27
28
29
30
31
|
# File 'lib/metric_fu/metrics/flay/grapher.rb', line 27
def data
[
["flay", @flay_score.join(",")]
]
end
|
#get_metrics(metrics, date) ⇒ Object
16
17
18
19
20
21
|
# File 'lib/metric_fu/metrics/flay/grapher.rb', line 16
def get_metrics(metrics, date)
if metrics && metrics[:flay]
@flay_score.push(metrics[:flay][:total_score].to_i)
@labels.update(@labels.size => date)
end
end
|
#output_filename ⇒ Object
33
34
35
|
# File 'lib/metric_fu/metrics/flay/grapher.rb', line 33
def output_filename
"flay.js"
end
|
#title ⇒ Object
23
24
25
|
# File 'lib/metric_fu/metrics/flay/grapher.rb', line 23
def title
"Flay: duplication"
end
|