Class: GovukComponent::Panel

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

Instance Attribute Summary collapse

Attributes included from Traits::CustomHtmlAttributes

#html_attributes

Instance Method Summary collapse

Methods inherited from Base

wrap_slot

Methods included from Traits::CustomClasses

#classes

Constructor Details

#initialize(title:, body:, classes: [], html_attributes: {}) ⇒ Panel

Returns a new instance of Panel.



4
5
6
7
8
9
# File 'app/components/govuk_component/panel.rb', line 4

def initialize(title:, body:, classes: [], html_attributes: {})
  super(classes: classes, html_attributes: html_attributes)

  @title = title
  @body  = body
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



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

def body
  @body
end

#titleObject

Returns the value of attribute title.



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

def title
  @title
end