Class: GovukComponent::TableComponent::RowComponent

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

Instance Attribute Summary collapse

Attributes inherited from Base

#html_attributes

Attributes included from GovukComponent::Traits::CustomHtmlAttributes

#html_attributes

Instance Method Summary collapse

Methods included from GovukComponent::Traits::CustomClasses

#classes

Methods included from Govuk::Components::Helpers::CssUtilities

#combine_classes

Constructor Details

#initialize(cell_data: nil, first_cell_is_header: false, header: false, classes: [], html_attributes: {}) ⇒ RowComponent

Returns a new instance of RowComponent.



6
7
8
9
10
11
12
13
# File 'app/components/govuk_component/table_component/row_component.rb', line 6

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

  @header = header
  @first_cell_is_header = first_cell_is_header

  build_cells_from_cell_data(cell_data)
end

Instance Attribute Details

#first_cell_is_headerObject (readonly)

Returns the value of attribute first_cell_is_header.



4
5
6
# File 'app/components/govuk_component/table_component/row_component.rb', line 4

def first_cell_is_header
  @first_cell_is_header
end

#headerObject (readonly)

Returns the value of attribute header.



4
5
6
# File 'app/components/govuk_component/table_component/row_component.rb', line 4

def header
  @header
end