Class: MetricFu::StatsGrapher
- Defined in:
- lib/graphs/stats_grapher.rb
Direct Known Subclasses
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.
-
#loc_counts ⇒ Object
Returns the value of attribute loc_counts.
-
#lot_counts ⇒ Object
Returns the value of attribute lot_counts.
Instance Method Summary collapse
- #get_metrics(metrics, date) ⇒ Object
-
#initialize ⇒ StatsGrapher
constructor
A new instance of StatsGrapher.
Methods inherited from Grapher
Methods included from GchartGrapher
Constructor Details
#initialize ⇒ StatsGrapher
Returns a new instance of StatsGrapher.
5 6 7 8 9 10 |
# File 'lib/graphs/stats_grapher.rb', line 5 def initialize super self.loc_counts = [] self.lot_counts = [] self.labels = {} end |
Instance Attribute Details
#labels ⇒ Object
Returns the value of attribute labels.
3 4 5 |
# File 'lib/graphs/stats_grapher.rb', line 3 def labels @labels end |
#loc_counts ⇒ Object
Returns the value of attribute loc_counts.
3 4 5 |
# File 'lib/graphs/stats_grapher.rb', line 3 def loc_counts @loc_counts end |
#lot_counts ⇒ Object
Returns the value of attribute lot_counts.
3 4 5 |
# File 'lib/graphs/stats_grapher.rb', line 3 def lot_counts @lot_counts end |
Instance Method Details
#get_metrics(metrics, date) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/graphs/stats_grapher.rb', line 12 def get_metrics(metrics, date) if metrics && metrics[:stats] self.loc_counts.push(metrics[:stats][:codeLOC].to_i) self.lot_counts.push(metrics[:stats][:testLOC].to_i) self.labels.update( { self.labels.size => date }) end end |