Class: GovukComponent::TableComponent::FootComponent
- Inherits:
-
Base
- Object
- ViewComponent::Base
- Base
- GovukComponent::TableComponent::FootComponent
- Defined in:
- app/components/govuk_component/table_component/foot_component.rb
Instance Attribute Summary collapse
-
#first_cell_is_header ⇒ Object
readonly
Returns the value of attribute first_cell_is_header.
-
#row_data ⇒ Object
readonly
Returns the value of attribute row_data.
Attributes inherited from Base
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(rows: nil, first_cell_is_header: false, classes: [], html_attributes: {}) ⇒ FootComponent
constructor
A new instance of FootComponent.
- #render? ⇒ Boolean
Methods inherited from Base
Constructor Details
#initialize(rows: nil, first_cell_is_header: false, classes: [], html_attributes: {}) ⇒ FootComponent
Returns a new instance of FootComponent.
14 15 16 17 18 19 20 21 22 23 |
# File 'app/components/govuk_component/table_component/foot_component.rb', line 14 def initialize(rows: nil, first_cell_is_header: false, classes: [], html_attributes: {}) @rows = rows @first_cell_is_header = first_cell_is_header super(classes:, html_attributes:) return unless rows.presence build_rows_from_row_data(rows) end |
Instance Attribute Details
#first_cell_is_header ⇒ Object (readonly)
Returns the value of attribute first_cell_is_header.
12 13 14 |
# File 'app/components/govuk_component/table_component/foot_component.rb', line 12 def first_cell_is_header @first_cell_is_header end |
#row_data ⇒ Object (readonly)
Returns the value of attribute row_data.
12 13 14 |
# File 'app/components/govuk_component/table_component/foot_component.rb', line 12 def row_data @row_data end |
Instance Method Details
#call ⇒ Object
25 26 27 |
# File 'app/components/govuk_component/table_component/foot_component.rb', line 25 def call tag.tfoot(**html_attributes) { safe_join(rows) } end |
#render? ⇒ Boolean
29 30 31 |
# File 'app/components/govuk_component/table_component/foot_component.rb', line 29 def render? rows.any? end |