Class: GovukComponent::Details

Inherits:
Base
  • Object
show all
Defined in:
app/components/govuk_component/details.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(summary:, description: nil, classes: [], html_attributes: {}) ⇒ Details

Returns a new instance of Details.



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

def initialize(summary:, description: nil, classes: [], html_attributes: {})
  super(classes: classes, html_attributes: html_attributes)

  @summary     = summary
  @description = description
end

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



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

def description
  @description
end

#summaryObject

Returns the value of attribute summary.



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

def summary
  @summary
end