Class: GovukComponent::TableComponent::BodyComponent
- Inherits:
-
Base
- Object
- ViewComponent::Base
- Base
- GovukComponent::TableComponent::BodyComponent
- Defined in:
- app/components/govuk_component/table_component/body_component.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(rows: nil, first_cell_is_header: false, classes: [], html_attributes: {}) ⇒ BodyComponent
constructor
A new instance of BodyComponent.
Methods inherited from Base
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
#call ⇒ Object
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 |