Class: GovukComponent::StartButtonComponent
- Defined in:
- app/components/govuk_component/start_button_component.rb
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
Attributes included from Traits::CustomHtmlAttributes
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(text:, href:, classes: [], html_attributes: {}) ⇒ StartButtonComponent
constructor
A new instance of StartButtonComponent.
Methods included from Traits::CustomClasses
Methods included from Govuk::Components::Helpers::CssUtilities
Constructor Details
#initialize(text:, href:, classes: [], html_attributes: {}) ⇒ StartButtonComponent
Returns a new instance of StartButtonComponent.
4 5 6 7 8 9 |
# File 'app/components/govuk_component/start_button_component.rb', line 4 def initialize(text:, href:, classes: [], html_attributes: {}) super(classes: classes, html_attributes: html_attributes) @text = text @href = href end |
Instance Attribute Details
#href ⇒ Object (readonly)
Returns the value of attribute href.
2 3 4 |
# File 'app/components/govuk_component/start_button_component.rb', line 2 def href @href end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
2 3 4 |
# File 'app/components/govuk_component/start_button_component.rb', line 2 def text @text end |
Instance Method Details
#call ⇒ Object
11 12 13 14 15 |
# File 'app/components/govuk_component/start_button_component.rb', line 11 def call link_to(href, **default_attributes, **html_attributes) do safe_join([text, icon]) end end |