Class: Railsboot::Table::CellComponent
- Inherits:
-
Component
- Object
- Component
- Railsboot::Table::CellComponent
- Defined in:
- app/components/railsboot/table/cell_component.rb
Constant Summary collapse
- TAGS =
["th", "td"].freeze
- DEFAULT_TAG =
"td".freeze
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(tag: DEFAULT_TAG, **html_attributes) ⇒ CellComponent
constructor
A new instance of CellComponent.
Constructor Details
#initialize(tag: DEFAULT_TAG, **html_attributes) ⇒ CellComponent
Returns a new instance of CellComponent.
5 6 7 8 |
# File 'app/components/railsboot/table/cell_component.rb', line 5 def initialize(tag: DEFAULT_TAG, **html_attributes) @tag = fetch_or_raise(tag, TAGS) @html_attributes = html_attributes end |
Instance Method Details
#call ⇒ Object
10 11 12 |
# File 'app/components/railsboot/table/cell_component.rb', line 10 def call content_tag @tag, content, **@html_attributes end |