Class: GovukComponent::SummaryListComponent::CardComponent
- Inherits:
-
Base
- Object
- ViewComponent::Base
- Base
- GovukComponent::SummaryListComponent::CardComponent
- Defined in:
- app/components/govuk_component/summary_list_component/card_component.rb
Instance Attribute Summary collapse
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(title:, actions: [], classes: [], html_attributes: {}) ⇒ CardComponent
constructor
A new instance of CardComponent.
Methods inherited from Base
Constructor Details
#initialize(title:, actions: [], classes: [], html_attributes: {}) ⇒ CardComponent
Returns a new instance of CardComponent.
7 8 9 10 11 12 |
# File 'app/components/govuk_component/summary_list_component/card_component.rb', line 7 def initialize(title:, actions: [], classes: [], html_attributes: {}) @title = title actions.each { |a| with_action { a } } if actions.any? super(classes:, html_attributes:) end |
Instance Attribute Details
#title ⇒ Object (readonly)
Returns the value of attribute title.
2 3 4 |
# File 'app/components/govuk_component/summary_list_component/card_component.rb', line 2 def title @title end |