Class: Railsboot::Table::CellComponent

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

Overview

ViewComponent: renders the cell block.

Constant Summary collapse

TAGS =

Tags.

%w[th td].freeze
DEFAULT_TAG =

Default tag.

"td".freeze

Instance Method Summary collapse

Constructor Details

#initialize(tag: DEFAULT_TAG, **html_attributes) ⇒ CellComponent

Returns a new instance of CellComponent.



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

def initialize(tag: DEFAULT_TAG, **html_attributes)
  @tag = fetch_or_raise(tag, TAGS)
  @html_attributes = html_attributes
end

Instance Method Details

#callObject



14
15
16
# File 'app/components/railsboot/table/cell_component.rb', line 14

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