Class: GovukComponent::TableComponent::BodyComponent

Inherits:
Base
  • Object
show all
Defined in:
app/components/govuk_component/table_component/body_component.rb

Instance Attribute Summary

Attributes inherited from Base

#html_attributes

Instance Method Summary collapse

Methods inherited from Base

#brand

Constructor Details

#initialize(rows: nil, first_cell_is_header: false, classes: [], html_attributes: {}) ⇒ BodyComponent

Returns a new instance of BodyComponent.



12
13
14
15
16
# File 'app/components/govuk_component/table_component/body_component.rb', line 12

def initialize(rows: nil, first_cell_is_header: false, classes: [], html_attributes: {})
  super(classes:, html_attributes:)

  build_rows_from_row_data(rows, first_cell_is_header)
end

Instance Method Details

#callObject



18
19
20
# File 'app/components/govuk_component/table_component/body_component.rb', line 18

def call
  tag.tbody(**html_attributes) { safe_join(rows) }
end