Class: GovukComponent::SummaryListComponent::CardComponent

Inherits:
Base
  • Object
show all
Defined in:
app/components/govuk_component/summary_list_component/card_component.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#html_attributes

Instance Method Summary collapse

Methods inherited from Base

#brand, #class_prefix

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

#titleObject (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