Class: UI::TableCell

Inherits:
Phlex::HTML
  • Object
show all
Includes:
TableCellBehavior
Defined in:
app/components/ui/table_cell.rb

Instance Method Summary collapse

Methods included from TableCellBehavior

#cell_classes, #cell_html_attributes, #render_cell

Constructor Details

#initialize(classes: "", **attributes) ⇒ TableCell

Returns a new instance of TableCell.



6
7
8
9
# File 'app/components/ui/table_cell.rb', line 6

def initialize(classes: "", **attributes)
  @classes = classes
  @attributes = attributes
end

Instance Method Details

#view_template(&block) ⇒ Object



11
12
13
14
15
# File 'app/components/ui/table_cell.rb', line 11

def view_template(&block)
  td(**cell_html_attributes.deep_merge(@attributes)) do
    yield if block_given?
  end
end