Class: GovukComponent::AccordionComponent
- Defined in:
- app/components/govuk_component/accordion_component.rb
Defined Under Namespace
Classes: SectionComponent
Instance Attribute Summary collapse
-
#heading_level ⇒ Object
readonly
Returns the value of attribute heading_level.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(heading_level: 2, classes: [], html_attributes: {}) ⇒ AccordionComponent
constructor
A new instance of AccordionComponent.
Constructor Details
#initialize(heading_level: 2, classes: [], html_attributes: {}) ⇒ AccordionComponent
Returns a new instance of AccordionComponent.
16 17 18 19 20 |
# File 'app/components/govuk_component/accordion_component.rb', line 16 def initialize(heading_level: 2, classes: [], html_attributes: {}) @heading_level = heading_tag(heading_level) super(classes: classes, html_attributes: html_attributes) end |
Instance Attribute Details
#heading_level ⇒ Object (readonly)
Returns the value of attribute heading_level.
14 15 16 |
# File 'app/components/govuk_component/accordion_component.rb', line 14 def heading_level @heading_level end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
14 15 16 |
# File 'app/components/govuk_component/accordion_component.rb', line 14 def id @id end |