Class: ChartBibz::ViewComponents::ChartViewComponent
- Inherits:
-
ApplicationViewComponent
- Object
- ApplicationViewComponent
- ChartBibz::ViewComponents::ChartViewComponent
- Defined in:
- lib/chart_bibz/view_components/chart_view_component.rb
Overview
Generate the chart view through the render method
Instance Attribute Summary
Attributes inherited from ApplicationViewComponent
Instance Method Summary collapse
-
#canvas ⇒ Object
The canvas object.
- #initialize(data = {}, options = {}, html_options = {}) ⇒ void constructor
-
#render ⇒ String
The canvas html.
Constructor Details
#initialize(data = {}, options = {}, html_options = {}) ⇒ void
19 20 21 22 23 |
# File 'lib/chart_bibz/view_components/chart_view_component.rb', line 19 def initialize(data = {}, = {}, = {}) @data = data = = end |
Instance Method Details
#canvas ⇒ Object
Returns The canvas object.
30 31 32 |
# File 'lib/chart_bibz/view_components/chart_view_component.rb', line 30 def canvas @canvas ||= CanvasViewComponent.new() end |
#render ⇒ String
Returns The canvas html.
26 |
# File 'lib/chart_bibz/view_components/chart_view_component.rb', line 26 delegate :render, to: :canvas |