Class: GovukComponent::DetailsComponent
- Defined in:
- app/components/govuk_component/details_component.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#open ⇒ Object
readonly
Returns the value of attribute open.
-
#summary_text ⇒ Object
readonly
Returns the value of attribute summary_text.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Attributes inherited from Base
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(summary_text: nil, text: nil, classes: [], id: nil, open: nil, html_attributes: {}) ⇒ DetailsComponent
constructor
A new instance of DetailsComponent.
Methods inherited from Base
Constructor Details
#initialize(summary_text: nil, text: nil, classes: [], id: nil, open: nil, html_attributes: {}) ⇒ DetailsComponent
Returns a new instance of DetailsComponent.
6 7 8 9 10 11 12 13 |
# File 'app/components/govuk_component/details_component.rb', line 6 def initialize(summary_text: nil, text: nil, classes: [], id: nil, open: nil, html_attributes: {}) @summary_text = summary_text @text = text @id = id @open = open super(classes:, html_attributes:) end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
2 3 4 |
# File 'app/components/govuk_component/details_component.rb', line 2 def id @id end |
#open ⇒ Object (readonly)
Returns the value of attribute open.
2 3 4 |
# File 'app/components/govuk_component/details_component.rb', line 2 def open @open end |
#summary_text ⇒ Object (readonly)
Returns the value of attribute summary_text.
2 3 4 |
# File 'app/components/govuk_component/details_component.rb', line 2 def summary_text @summary_text end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
2 3 4 |
# File 'app/components/govuk_component/details_component.rb', line 2 def text @text end |
Instance Method Details
#call ⇒ Object
15 16 17 18 19 |
# File 'app/components/govuk_component/details_component.rb', line 15 def call tag.details(id:, open:, **html_attributes) do safe_join([summary, description]) end end |