Class: GovukComponent::AccordionComponent

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

Defined Under Namespace

Classes: SectionComponent

Instance Attribute Summary collapse

Attributes inherited from Base

#html_attributes

Instance Method Summary collapse

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_levelObject (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

#idObject (readonly)

Returns the value of attribute id.



14
15
16
# File 'app/components/govuk_component/accordion_component.rb', line 14

def id
  @id
end