Class: Railsboot::Table::CellComponent

Inherits:
Component
  • Object
show all
Defined in:
app/components/railsboot/table/cell_component.rb

Constant Summary collapse

TAGS =
["th", "td"].freeze
DEFAULT_TAG =
"td".freeze

Instance Method Summary collapse

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

#callObject



10
11
12
# File 'app/components/railsboot/table/cell_component.rb', line 10

def call
   @tag, content, **@html_attributes
end