Class: GovukComponent::TaskListComponent::StatusComponent
- Inherits:
-
Base
- Object
- ViewComponent::Base
- Base
- GovukComponent::TaskListComponent::StatusComponent
- Defined in:
- app/components/govuk_component/task_list_component/status_component.rb
Instance Attribute Summary collapse
-
#cannot_start_yet ⇒ Object
readonly
Returns the value of attribute cannot_start_yet.
-
#count ⇒ Object
readonly
Returns the value of attribute count.
-
#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, id_prefix: nil, count: nil, cannot_start_yet: false, classes: [], html_attributes: {}) ⇒ StatusComponent
constructor
A new instance of StatusComponent.
- #render? ⇒ Boolean
Methods inherited from Base
Constructor Details
#initialize(text: nil, id_prefix: nil, count: nil, cannot_start_yet: false, classes: [], html_attributes: {}) ⇒ StatusComponent
Returns a new instance of StatusComponent.
5 6 7 8 9 10 11 12 |
# File 'app/components/govuk_component/task_list_component/status_component.rb', line 5 def initialize(text: nil, id_prefix: nil, count: nil, cannot_start_yet: false, classes: [], html_attributes: {}) @text = text @count = count @id_prefix = id_prefix @cannot_start_yet = cannot_start_yet super(classes:, html_attributes:) end |
Instance Attribute Details
#cannot_start_yet ⇒ Object (readonly)
Returns the value of attribute cannot_start_yet.
3 4 5 |
# File 'app/components/govuk_component/task_list_component/status_component.rb', line 3 def cannot_start_yet @cannot_start_yet end |
#count ⇒ Object (readonly)
Returns the value of attribute count.
3 4 5 |
# File 'app/components/govuk_component/task_list_component/status_component.rb', line 3 def count @count end |
#id_prefix ⇒ Object (readonly)
Returns the value of attribute id_prefix.
3 4 5 |
# File 'app/components/govuk_component/task_list_component/status_component.rb', line 3 def id_prefix @id_prefix end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
3 4 5 |
# File 'app/components/govuk_component/task_list_component/status_component.rb', line 3 def text @text end |
Instance Method Details
#call ⇒ Object
14 15 16 |
# File 'app/components/govuk_component/task_list_component/status_component.rb', line 14 def call tag.div(status_text, **html_attributes) end |
#render? ⇒ Boolean
18 19 20 |
# File 'app/components/govuk_component/task_list_component/status_component.rb', line 18 def render? status_text.present? end |