Class: ChartBibz::ViewComponents::CanvasViewComponent
- Inherits:
-
ApplicationViewComponent
- Object
- ApplicationViewComponent
- ChartBibz::ViewComponents::CanvasViewComponent
- Defined in:
- lib/chart_bibz/view_components/canvas_view_component.rb
Overview
Generate the canvas view through the render method
Constant Summary collapse
- WIDTH =
Constants
400
- HEIGHT =
400
Instance Attribute Summary
Attributes inherited from ApplicationViewComponent
Instance Method Summary collapse
-
#id ⇒ String
The canvas html id.
- #initialize(args = {}) ⇒ void constructor
-
#render ⇒ String
Generate the html canvas.
Constructor Details
#initialize(args = {}) ⇒ void
13 14 15 |
# File 'lib/chart_bibz/view_components/canvas_view_component.rb', line 13 def initialize(args = {}) @args = args end |
Instance Method Details
#id ⇒ String
Returns The canvas html id.
24 25 26 |
# File 'lib/chart_bibz/view_components/canvas_view_component.rb', line 24 def id [:id] end |
#render ⇒ String
Generate the html canvas
19 20 21 |
# File 'lib/chart_bibz/view_components/canvas_view_component.rb', line 19 def render tag.canvas(**) end |