Class: GovukComponent::BackLink

Inherits:
Base
  • Object
show all
Defined in:
app/components/govuk_component/back_link.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(text:, href:, classes: nil, html_attributes: {}) ⇒ BackLink

Returns a new instance of BackLink.



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

def initialize(text:, href:, classes: nil, html_attributes: {})
  super(classes: classes, html_attributes: html_attributes)

  @text = text
  @href = href
end

Instance Attribute Details

#hrefObject

Returns the value of attribute href.



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

def href
  @href
end

#optionsObject

Returns the value of attribute options.



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

def options
  @options
end

#textObject

Returns the value of attribute text.



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

def text
  @text
end