class Compendium::AbstractChartProvider

Attributes

chart[R]

Public Class Methods

find_chart_provider() click to toggle source

Chart providers need to override this method to add a hook for themselves

# File lib/compendium/abstract_chart_provider.rb, line 27
def self.find_chart_provider
  nil
end
new(type, data_or_url, params = {}, &setup_proc) click to toggle source

@param type [Symbol] The type of chart you want to render (:pie, :line, etc).

Accepted types might vary by provider.

@param data_or_url [Enumerable or String] The data or URL to the data you wish to render.

Providers may not support loading data remotely.

@param params [Hash] If data_or_url is a URL, the params to use for the AJAX request

# File lib/compendium/abstract_chart_provider.rb, line 18
def initialize(type, data_or_url, params = {}, &setup_proc)
  raise NotImplementedError
end

Public Instance Methods

render(template, container) click to toggle source
# File lib/compendium/abstract_chart_provider.rb, line 22
def render(template, container)
  raise NotImplementedError
end

Private Instance Methods

method_missing(name, *args, &block) click to toggle source
Calls superclass method
# File lib/compendium/abstract_chart_provider.rb, line 33
def method_missing(name, *args, &block)
  return chart.send(name, *args, &block) if chart.respond_to?(name)
  super
end
respond_to_missing?(name, include_private = false) click to toggle source
Calls superclass method
# File lib/compendium/abstract_chart_provider.rb, line 38
def respond_to_missing?(name, include_private = false)
  return true if chart.respond_to?(name)
  super
end