Class: GovukComponent::BackLinkComponent
- Defined in:
- app/components/govuk_component/back_link_component.rb
Instance Attribute Summary collapse
-
#href ⇒ Object
readonly
Returns the value of attribute href.
-
#inverse ⇒ Object
readonly
Returns the value of attribute inverse.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Attributes inherited from Base
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(href:, inverse: false, text: config.default_back_link_text, classes: [], html_attributes: {}) ⇒ BackLinkComponent
constructor
A new instance of BackLinkComponent.
Methods inherited from Base
Constructor Details
#initialize(href:, inverse: false, text: config.default_back_link_text, classes: [], html_attributes: {}) ⇒ BackLinkComponent
Returns a new instance of BackLinkComponent.
4 5 6 7 8 9 10 |
# File 'app/components/govuk_component/back_link_component.rb', line 4 def initialize(href:, inverse: false, text: config.default_back_link_text, classes: [], html_attributes: {}) @text = text @href = href @inverse = inverse super(classes:, html_attributes:) end |
Instance Attribute Details
#href ⇒ Object (readonly)
Returns the value of attribute href.
2 3 4 |
# File 'app/components/govuk_component/back_link_component.rb', line 2 def href @href end |
#inverse ⇒ Object (readonly)
Returns the value of attribute inverse.
2 3 4 |
# File 'app/components/govuk_component/back_link_component.rb', line 2 def inverse @inverse end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
2 3 4 |
# File 'app/components/govuk_component/back_link_component.rb', line 2 def text @text end |
Instance Method Details
#call ⇒ Object
12 13 14 |
# File 'app/components/govuk_component/back_link_component.rb', line 12 def call link_to(link_content, href, **html_attributes) end |