Class: GovukComponent::SummaryListComponent
- Defined in:
- app/components/govuk_component/summary_list_component.rb
Defined Under Namespace
Classes: ActionComponent, KeyComponent, RowComponent, ValueComponent
Instance Attribute Summary collapse
-
#actions ⇒ Object
readonly
Returns the value of attribute actions.
-
#borders ⇒ Object
readonly
Returns the value of attribute borders.
Attributes inherited from Base
Attributes included from Traits::CustomHtmlAttributes
Instance Method Summary collapse
- #classes ⇒ Object
-
#initialize(rows: nil, actions: true, borders: true, classes: [], html_attributes: {}) ⇒ SummaryListComponent
constructor
A new instance of SummaryListComponent.
Methods included from Govuk::Components::Helpers::CssUtilities
Constructor Details
#initialize(rows: nil, actions: true, borders: true, classes: [], html_attributes: {}) ⇒ SummaryListComponent
Returns a new instance of SummaryListComponent.
14 15 16 17 18 19 20 21 22 23 |
# File 'app/components/govuk_component/summary_list_component.rb', line 14 def initialize(rows: nil, actions: true, borders: true, classes: [], html_attributes: {}) super(classes: classes, html_attributes: html_attributes) @borders = borders @show_actions_column = actions return unless rows.presence build(rows) end |
Instance Attribute Details
#actions ⇒ Object (readonly)
Returns the value of attribute actions.
3 4 5 |
# File 'app/components/govuk_component/summary_list_component.rb', line 3 def actions @actions end |
#borders ⇒ Object (readonly)
Returns the value of attribute borders.
3 4 5 |
# File 'app/components/govuk_component/summary_list_component.rb', line 3 def borders @borders end |
Instance Method Details
#classes ⇒ Object
25 26 27 |
# File 'app/components/govuk_component/summary_list_component.rb', line 25 def classes super.append(borders_class).compact end |