Class: MetricFu::Graph
- Inherits:
-
Object
- Object
- MetricFu::Graph
- Defined in:
- lib/base/graph.rb
Instance Attribute Summary collapse
-
#clazz ⇒ Object
Returns the value of attribute clazz.
Instance Method Summary collapse
- #add(graph_type, graph_engine) ⇒ Object
- #generate ⇒ Object
-
#initialize ⇒ Graph
constructor
A new instance of Graph.
Constructor Details
#initialize ⇒ Graph
Returns a new instance of Graph.
11 12 13 |
# File 'lib/base/graph.rb', line 11 def initialize self.clazz = [] end |
Instance Attribute Details
#clazz ⇒ Object
Returns the value of attribute clazz.
9 10 11 |
# File 'lib/base/graph.rb', line 9 def clazz @clazz end |
Instance Method Details
#add(graph_type, graph_engine) ⇒ Object
15 16 17 18 |
# File 'lib/base/graph.rb', line 15 def add(graph_type, graph_engine) grapher_name = graph_type.to_s.capitalize + graph_engine.to_s.capitalize + "Grapher" self.clazz.push MetricFu.const_get(grapher_name).new end |
#generate ⇒ Object
21 22 23 24 25 26 |
# File 'lib/base/graph.rb', line 21 def generate return if self.clazz.empty? puts "Generating graphs" graphed_reports.each { |report| process_report(report) } self.clazz.each { |grapher| grapher.graph! } end |