Class: MetricFu::RailsBestPracticesGrapher
- Defined in:
- lib/graphs/rails_best_practices_grapher.rb
Direct Known Subclasses
RailsBestPracticesBluffGrapher, RailsBestPracticesGchartGrapher
Constant Summary
Constants inherited from Grapher
Grapher::BLUFF_DEFAULT_OPTIONS, Grapher::BLUFF_GRAPH_SIZE
Constants included from GchartGrapher
GchartGrapher::COLORS, GchartGrapher::GCHART_GRAPH_SIZE, GchartGrapher::NUMBER_OF_TICKS
Instance Attribute Summary collapse
-
#labels ⇒ Object
Returns the value of attribute labels.
-
#rails_best_practices_count ⇒ Object
Returns the value of attribute rails_best_practices_count.
Instance Method Summary collapse
- #get_metrics(metrics, date) ⇒ Object
-
#initialize ⇒ RailsBestPracticesGrapher
constructor
A new instance of RailsBestPracticesGrapher.
Methods inherited from Grapher
Methods included from GchartGrapher
Constructor Details
#initialize ⇒ RailsBestPracticesGrapher
Returns a new instance of RailsBestPracticesGrapher.
5 6 7 8 9 |
# File 'lib/graphs/rails_best_practices_grapher.rb', line 5 def initialize super @rails_best_practices_count = [] @labels = {} end |
Instance Attribute Details
#labels ⇒ Object
Returns the value of attribute labels.
3 4 5 |
# File 'lib/graphs/rails_best_practices_grapher.rb', line 3 def labels @labels end |
#rails_best_practices_count ⇒ Object
Returns the value of attribute rails_best_practices_count.
3 4 5 |
# File 'lib/graphs/rails_best_practices_grapher.rb', line 3 def rails_best_practices_count @rails_best_practices_count end |
Instance Method Details
#get_metrics(metrics, date) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/graphs/rails_best_practices_grapher.rb', line 11 def get_metrics(metrics, date) if metrics && metrics[:rails_best_practices] size = (metrics[:rails_best_practices][:problems] || []).size @rails_best_practices_count.push(size) @labels.update( { @labels.size => date }) end end |