Class: GovukComponent::TaskListComponent::TitleComponent
- Inherits:
-
Base
- Object
- ViewComponent::Base
- Base
- GovukComponent::TaskListComponent::TitleComponent
- 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 inherited from Base
Constructor Details
#initialize(text: nil, href: nil, hint: nil, id_prefix: nil, count: nil, classes: [], html_attributes: {}) ⇒ TitleComponent
Returns a new instance of TitleComponent.
7 8 9 10 11 12 13 14 15 |
# File 'app/components/govuk_component/task_list_component/title_component.rb', line 7 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.
5 6 7 |
# File 'app/components/govuk_component/task_list_component/title_component.rb', line 5 def count @count end |
#hint ⇒ Object (readonly)
Returns the value of attribute hint.
5 6 7 |
# File 'app/components/govuk_component/task_list_component/title_component.rb', line 5 def hint @hint end |
#href ⇒ Object (readonly)
Returns the value of attribute href.
5 6 7 |
# File 'app/components/govuk_component/task_list_component/title_component.rb', line 5 def href @href end |
#id_prefix ⇒ Object (readonly)
Returns the value of attribute id_prefix.
5 6 7 |
# File 'app/components/govuk_component/task_list_component/title_component.rb', line 5 def id_prefix @id_prefix end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
5 6 7 |
# File 'app/components/govuk_component/task_list_component/title_component.rb', line 5 def text @text end |
Instance Method Details
#call ⇒ Object
17 18 19 |
# File 'app/components/govuk_component/task_list_component/title_component.rb', line 17 def call tag.div(**html_attributes) { safe_join([title_content, hint_content]) } end |