Class: GovukComponent::InsetText
- Defined in:
- app/components/govuk_component/inset_text.rb
Instance Attribute Summary collapse
-
#text ⇒ Object
Returns the value of attribute text.
Attributes included from Traits::CustomHtmlAttributes
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(text:, classes: [], html_attributes: {}) ⇒ InsetText
constructor
A new instance of InsetText.
Methods inherited from Base
Methods included from Traits::CustomClasses
Constructor Details
#initialize(text:, classes: [], html_attributes: {}) ⇒ InsetText
Returns a new instance of InsetText.
4 5 6 7 8 |
# File 'app/components/govuk_component/inset_text.rb', line 4 def initialize(text:, classes: [], html_attributes: {}) super(classes: classes, html_attributes: html_attributes) @text = text end |
Instance Attribute Details
#text ⇒ Object
Returns the value of attribute text.
2 3 4 |
# File 'app/components/govuk_component/inset_text.rb', line 2 def text @text end |
Instance Method Details
#call ⇒ Object
10 11 12 |
# File 'app/components/govuk_component/inset_text.rb', line 10 def call tag.div(class: classes, **html_attributes) { @text } end |