Class: GovukComponent::TaskListComponent::TitleComponent
- Inherits:
-
Base
- Object
- ViewComponent::Base
- Base
- GovukComponent::TaskListComponent::TitleComponent
- Includes:
- GovukLinkHelper, GovukVisuallyHiddenHelper
- Defined in:
- app/components/govuk_component/task_list_component/title_component.rb
Instance Attribute Summary collapse
-
#count ⇒ Object
readonly
Returns the value of attribute count.
-
#hint ⇒ Object
readonly
Returns the value of attribute hint.
-
#href ⇒ Object
readonly
Returns the value of attribute href.
-
#id_prefix ⇒ Object
readonly
Returns the value of attribute id_prefix.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Attributes inherited from Base
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(text: nil, href: nil, hint: nil, id_prefix: nil, count: nil, classes: [], html_attributes: {}) ⇒ TitleComponent
constructor
A new instance of TitleComponent.
Methods included from GovukVisuallyHiddenHelper
Methods included from GovukLinkHelper
#govuk_breadcrumb_link_to, #govuk_button_classes, #govuk_button_link_to, #govuk_button_to, #govuk_footer_link_to, #govuk_link_classes, #govuk_link_to, #govuk_mail_to
Methods inherited from Base
Constructor Details
#initialize(text: nil, href: nil, hint: nil, id_prefix: nil, count: nil, classes: [], html_attributes: {}) ⇒ TitleComponent
10 11 12 13 14 15 16 17 18 |
# File 'app/components/govuk_component/task_list_component/title_component.rb', line 10 def initialize(text: nil, href: nil, hint: nil, id_prefix: nil, count: nil, classes: [], html_attributes: {}) @text = text @href = href @hint = hint @id_prefix = id_prefix @count = count super(classes:, html_attributes:) end |
Instance Attribute Details
#count ⇒ Object (readonly)
Returns the value of attribute count.
8 9 10 |
# File 'app/components/govuk_component/task_list_component/title_component.rb', line 8 def count @count end |
#hint ⇒ Object (readonly)
Returns the value of attribute hint.
8 9 10 |
# File 'app/components/govuk_component/task_list_component/title_component.rb', line 8 def hint @hint end |
#href ⇒ Object (readonly)
Returns the value of attribute href.
8 9 10 |
# File 'app/components/govuk_component/task_list_component/title_component.rb', line 8 def href @href end |
#id_prefix ⇒ Object (readonly)
Returns the value of attribute id_prefix.
8 9 10 |
# File 'app/components/govuk_component/task_list_component/title_component.rb', line 8 def id_prefix @id_prefix end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
8 9 10 |
# File 'app/components/govuk_component/task_list_component/title_component.rb', line 8 def text @text end |
Instance Method Details
#call ⇒ Object
20 21 22 |
# File 'app/components/govuk_component/task_list_component/title_component.rb', line 20 def call tag.div(**html_attributes) { safe_join([title_content, hint_content]) } end |