Class: MetricFu::FlayGrapher

Inherits:
Grapher
  • Object
show all
Defined in:
lib/graphs/flay_grapher.rb

Direct Known Subclasses

FlayBluffGrapher, FlayGchartGrapher

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

Instance Method Summary collapse

Methods inherited from Grapher

require_graphing_gem

Methods included from GchartGrapher

#determine_y_axis_scale

Constructor Details

#initializeFlayGrapher

Returns a new instance of FlayGrapher.



5
6
7
8
9
# File 'lib/graphs/flay_grapher.rb', line 5

def initialize
  super
  @flay_score = []
  @labels = {}
end

Instance Attribute Details

#flay_scoreObject

Returns the value of attribute flay_score.



3
4
5
# File 'lib/graphs/flay_grapher.rb', line 3

def flay_score
  @flay_score
end

#labelsObject

Returns the value of attribute labels.



3
4
5
# File 'lib/graphs/flay_grapher.rb', line 3

def labels
  @labels
end

Instance Method Details

#get_metrics(metrics, date) ⇒ Object



11
12
13
14
15
16
# File 'lib/graphs/flay_grapher.rb', line 11

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