Class: GovukComponent::PanelComponent

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

Defined Under Namespace

Classes: Action

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(title_text: nil, text: nil, interruption: false, heading_level: 1, id: nil, classes: [], html_attributes: {}) ⇒ PanelComponent

Returns a new instance of PanelComponent.



7
8
9
10
11
12
13
14
15
# File 'app/components/govuk_component/panel_component.rb', line 7

def initialize(title_text: nil, text: nil, interruption: false, heading_level: 1, id: nil, classes: [], html_attributes: {})
  @heading_level = heading_level
  @title_text    = title_text
  @text          = text
  @id            = id
  @interruption  = interruption

  super(classes:, html_attributes:)
end

Instance Attribute Details

#heading_levelObject (readonly)

Returns the value of attribute heading_level.



2
3
4
# File 'app/components/govuk_component/panel_component.rb', line 2

def heading_level
  @heading_level
end

#idObject (readonly)

Returns the value of attribute id.



2
3
4
# File 'app/components/govuk_component/panel_component.rb', line 2

def id
  @id
end

#interruptionObject (readonly)

Returns the value of attribute interruption.



2
3
4
# File 'app/components/govuk_component/panel_component.rb', line 2

def interruption
  @interruption
end

#textObject (readonly)

Returns the value of attribute text.



2
3
4
# File 'app/components/govuk_component/panel_component.rb', line 2

def text
  @text
end

#title_textObject (readonly)

Returns the value of attribute title_text.



2
3
4
# File 'app/components/govuk_component/panel_component.rb', line 2

def title_text
  @title_text
end