Class: UI::TableRow

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

Instance Method Summary collapse

Methods included from TableRowBehavior

#render_row, #row_classes, #row_html_attributes

Constructor Details

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

Returns a new instance of TableRow.



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

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

Instance Method Details

#cell(classes: "", **attributes, &block) ⇒ Object



22
23
24
# File 'app/components/ui/table_row.rb', line 22

def cell(classes: "", **attributes, &block)
  render UI::TableCell.new(classes: classes, **attributes, &block)
end

#head(classes: "", **attributes, &block) ⇒ Object

DSL methods



18
19
20
# File 'app/components/ui/table_row.rb', line 18

def head(classes: "", **attributes, &block)
  render UI::TableHead.new(classes: classes, **attributes, &block)
end

#view_template(&block) ⇒ Object



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

def view_template(&block)
  tr(**row_html_attributes.deep_merge(@attributes)) do
    yield(self) if block_given?
  end
end