Class: GovukComponent::TableComponent::CellComponent
- Inherits:
-
Base
- Object
- ViewComponent::Base
- Base
- GovukComponent::TableComponent::CellComponent
- Defined in:
- app/components/govuk_component/table_component/cell_component.rb
Constant Summary collapse
- WIDTHS =
{ "full" => "govuk-input govuk-!-width-full", "three-quarters" => "govuk-input govuk-!-width-three-quarters", "two-thirds" => "govuk-input govuk-!-width-two-thirds", "one-half" => "govuk-input govuk-!-width-one-half", "one-third" => "govuk-input govuk-!-width-one-third", "one-quarter" => "govuk-input govuk-!-width-one-quarter", }.freeze
Instance Attribute Summary collapse
-
#header ⇒ Object
readonly
Returns the value of attribute header.
-
#numeric ⇒ Object
(also: #numeric?)
readonly
Returns the value of attribute numeric.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Attributes inherited from Base
Attributes included from GovukComponent::Traits::CustomHtmlAttributes
Instance Method Summary collapse
-
#initialize(header: false, text: nil, numeric: false, width: nil, classes: [], html_attributes: {}) ⇒ CellComponent
constructor
A new instance of CellComponent.
Methods included from GovukComponent::Traits::CustomClasses
Methods included from Govuk::Components::Helpers::CssUtilities
Constructor Details
#initialize(header: false, text: nil, numeric: false, width: nil, classes: [], html_attributes: {}) ⇒ CellComponent
Returns a new instance of CellComponent.
15 16 17 18 19 20 21 22 |
# File 'app/components/govuk_component/table_component/cell_component.rb', line 15 def initialize(header: false, text: nil, numeric: false, width: nil, classes: [], html_attributes: {}) super(classes: classes, html_attributes: html_attributes) @header = header @text = text @numeric = numeric @width = width end |
Instance Attribute Details
#header ⇒ Object (readonly)
Returns the value of attribute header.
2 3 4 |
# File 'app/components/govuk_component/table_component/cell_component.rb', line 2 def header @header end |
#numeric ⇒ Object (readonly) Also known as: numeric?
Returns the value of attribute numeric.
2 3 4 |
# File 'app/components/govuk_component/table_component/cell_component.rb', line 2 def numeric @numeric end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
2 3 4 |
# File 'app/components/govuk_component/table_component/cell_component.rb', line 2 def text @text end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
2 3 4 |
# File 'app/components/govuk_component/table_component/cell_component.rb', line 2 def width @width end |