Class: SdrViewComponents::Tables::CellComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- SdrViewComponents::Tables::CellComponent
- Defined in:
- app/components/sdr_view_components/tables/cell_component.rb
Overview
Component for rendering a table cell.
Instance Attribute Summary collapse
-
#cell_options ⇒ Object
readonly
Returns the value of attribute cell_options.
-
#colspan ⇒ Object
readonly
Returns the value of attribute colspan.
Instance Method Summary collapse
- #classes ⇒ Object
-
#initialize(colspan: nil, classes: [], **cell_options) ⇒ CellComponent
constructor
A new instance of CellComponent.
Methods inherited from BaseComponent
#args_for, #merge_actions, #merge_classes
Constructor Details
#initialize(colspan: nil, classes: [], **cell_options) ⇒ CellComponent
Returns a new instance of CellComponent.
7 8 9 10 11 12 |
# File 'app/components/sdr_view_components/tables/cell_component.rb', line 7 def initialize(colspan: nil, classes: [], **) @colspan = colspan @classes = classes @cell_options = super() end |
Instance Attribute Details
#cell_options ⇒ Object (readonly)
Returns the value of attribute cell_options.
14 15 16 |
# File 'app/components/sdr_view_components/tables/cell_component.rb', line 14 def @cell_options end |
#colspan ⇒ Object (readonly)
Returns the value of attribute colspan.
14 15 16 |
# File 'app/components/sdr_view_components/tables/cell_component.rb', line 14 def colspan @colspan end |
Instance Method Details
#classes ⇒ Object
16 17 18 |
# File 'app/components/sdr_view_components/tables/cell_component.rb', line 16 def classes merge_classes(@classes) end |