Class: MetricFu::Grapher
- Inherits:
-
Object
show all
- Defined in:
- lib/metric_fu/reporting/graphs/grapher.rb
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(opts = {}) ⇒ Grapher
Returns a new instance of Grapher.
20
21
22
|
# File 'lib/metric_fu/reporting/graphs/grapher.rb', line 20
def initialize(opts = {})
self.output_directory = opts[:output_directory]
end
|
Instance Attribute Details
#output_directory ⇒ Object
Returns the value of attribute output_directory.
18
19
20
|
# File 'lib/metric_fu/reporting/graphs/grapher.rb', line 18
def output_directory
@output_directory
end
|
Class Method Details
.get_grapher(metric) ⇒ Object
14
15
16
|
# File 'lib/metric_fu/reporting/graphs/grapher.rb', line 14
def self.get_grapher(metric)
graphers.find { |grapher|grapher.metric.to_s == metric.to_s }
end
|
.graphers ⇒ Object
Returns all subclassed graphers [Array<MetricFu::Grapher>].
6
7
8
|
# File 'lib/metric_fu/reporting/graphs/grapher.rb', line 6
def self.graphers
@graphers
end
|
Instance Method Details
#date ⇒ Object
46
47
48
|
# File 'lib/metric_fu/reporting/graphs/grapher.rb', line 46
def date
not_implemented
end
|
#get_metrics(_metrics, _sortable_prefix) ⇒ Object
28
29
30
|
# File 'lib/metric_fu/reporting/graphs/grapher.rb', line 28
def get_metrics(_metrics, _sortable_prefix)
not_implemented
end
|
#graph! ⇒ Object
32
33
34
35
36
37
38
39
40
|
# File 'lib/metric_fu/reporting/graphs/grapher.rb', line 32
def graph!
labels = MultiJson.dump(@labels)
content = <<-EOS
var graph_title = '#{title}';
#{build_data(data)}
var graph_labels = #{labels};
EOS
File.open(File.join(output_directory, "results", output_filename), "w") { |f| f << content }
end
|
#output_filename ⇒ Object
50
51
52
|
# File 'lib/metric_fu/reporting/graphs/grapher.rb', line 50
def output_filename
not_implemented
end
|
#title ⇒ Object
42
43
44
|
# File 'lib/metric_fu/reporting/graphs/grapher.rb', line 42
def title
not_implemented
end
|