Class: CCS::Components::GovUK::Table::Body::HeadCell
- Defined in:
- lib/ccs/components/govuk/table/body/head_cell.rb
Overview
GOV.UK Table Body head cell
The individual table body head cell
Constant Summary collapse
- DEFAULT_ATTRIBUTES =
The default attributes for the table body head cell
{ class: 'govuk-table__header' }.freeze
Instance Method Summary collapse
-
#initialize(text:, **options) ⇒ HeadCell
constructor
A new instance of HeadCell.
-
#render ⇒ ActiveSupport::SafeBuffer
Generates the HTML for the GOV.UK Table Body head cell.
Constructor Details
#initialize(text:, **options) ⇒ HeadCell
Returns a new instance of HeadCell.
28 29 30 31 32 33 34 |
# File 'lib/ccs/components/govuk/table/body/head_cell.rb', line 28 def initialize(text:, **) super(**) @options[:attributes][:scope] = 'row' @text = text end |
Instance Method Details
#render ⇒ ActiveSupport::SafeBuffer
Generates the HTML for the GOV.UK Table Body head cell
40 41 42 |
# File 'lib/ccs/components/govuk/table/body/head_cell.rb', line 40 def render tag.th(text, **[:attributes]) end |