Class: Compendium::AbstractChartProvider
- Inherits:
-
Object
- Object
- Compendium::AbstractChartProvider
- Defined in:
- lib/compendium/abstract_chart_provider.rb
Overview
Abstract wrapper for rendering charts To add a new chart provider, #initialize and #render must be implemented Custom providers should also override Compendium::AbstractChartProvider.find_chart_provider (but fallback to super)
Instance Attribute Summary collapse
-
#chart ⇒ Object
readonly
Returns the value of attribute chart.
Class Method Summary collapse
-
.find_chart_provider ⇒ Object
Chart providers need to override this method to add a hook for themselves.
Instance Method Summary collapse
-
#initialize(type, data_or_url, params = {}, &setup_proc) ⇒ AbstractChartProvider
constructor
A new instance of AbstractChartProvider.
- #render(template, container) ⇒ Object
Constructor Details
#initialize(type, data_or_url, params = {}, &setup_proc) ⇒ AbstractChartProvider
Returns a new instance of AbstractChartProvider.
16 17 18 |
# File 'lib/compendium/abstract_chart_provider.rb', line 16 def initialize(type, data_or_url, params = {}, &setup_proc) raise NotImplementedError end |
Instance Attribute Details
#chart ⇒ Object (readonly)
Returns the value of attribute chart.
9 10 11 |
# File 'lib/compendium/abstract_chart_provider.rb', line 9 def chart @chart end |
Class Method Details
.find_chart_provider ⇒ Object
Chart providers need to override this method to add a hook for themselves
25 26 27 |
# File 'lib/compendium/abstract_chart_provider.rb', line 25 def self.find_chart_provider nil end |
Instance Method Details
#render(template, container) ⇒ Object
20 21 22 |
# File 'lib/compendium/abstract_chart_provider.rb', line 20 def render(template, container) raise NotImplementedError end |