Class: Compendium::Presenters::Chart
- Defined in:
- app/classes/compendium/presenters/chart.rb
Instance Attribute Summary collapse
-
#chart_provider ⇒ Object
readonly
Returns the value of attribute chart_provider.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Attributes inherited from Query
#metrics, #name, #options, #proc, #report, #results, #through
Instance Method Summary collapse
-
#initialize(template, object, type, container = nil, &setup) ⇒ Chart
constructor
A new instance of Chart.
- #render ⇒ Object
Methods inherited from Query
#add_metric, #initialize_clone, #nil?, #ran?, #render_chart, #render_table, #run
Constructor Details
#initialize(template, object, type, container = nil, &setup) ⇒ Chart
Returns a new instance of Chart.
5 6 7 8 9 10 11 12 13 14 |
# File 'app/classes/compendium/presenters/chart.rb', line 5 def initialize(template, object, type, container = nil, &setup) super(template, object) @data = results.records @data = @data[0...-1] if query.[:totals] @container = container || query.name initialize_chart_provider(type, &setup) end |
Instance Attribute Details
#chart_provider ⇒ Object (readonly)
Returns the value of attribute chart_provider.
3 4 5 |
# File 'app/classes/compendium/presenters/chart.rb', line 3 def chart_provider @chart_provider end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
3 4 5 |
# File 'app/classes/compendium/presenters/chart.rb', line 3 def data @data end |
Instance Method Details
#render ⇒ Object
16 17 18 |
# File 'app/classes/compendium/presenters/chart.rb', line 16 def render chart_provider.render(@template, @container) end |