Class: GovukComponent::StartButtonComponent
- Defined in:
- app/components/govuk_component/start_button_component.rb
Constant Summary collapse
- BUTTON_ATTRIBUTES =
{ role: 'button', draggable: 'false', data: { module: 'govuk-button' } }.freeze
Instance Attribute Summary collapse
-
#href ⇒ Object
readonly
Returns the value of attribute href.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Attributes inherited from Base
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(text:, href:, classes: [], html_attributes: {}) ⇒ StartButtonComponent
constructor
A new instance of StartButtonComponent.
Constructor Details
#initialize(text:, href:, classes: [], html_attributes: {}) ⇒ StartButtonComponent
Returns a new instance of StartButtonComponent.
10 11 12 13 14 15 |
# File 'app/components/govuk_component/start_button_component.rb', line 10 def initialize(text:, href:, classes: [], html_attributes: {}) @text = text @href = href super(classes: classes, html_attributes: html_attributes) end |
Instance Attribute Details
#href ⇒ Object (readonly)
Returns the value of attribute href.
8 9 10 |
# File 'app/components/govuk_component/start_button_component.rb', line 8 def href @href end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
8 9 10 |
# File 'app/components/govuk_component/start_button_component.rb', line 8 def text @text end |
Instance Method Details
#call ⇒ Object
17 18 19 20 21 |
# File 'app/components/govuk_component/start_button_component.rb', line 17 def call link_to(href, **html_attributes) do safe_join([text, icon]) end end |