Class: GovukComponent::TaskListComponent::StatusComponent

Inherits:
Base
  • Object
show all
Defined in:
app/components/govuk_component/task_list_component/status_component.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#html_attributes

Instance Method Summary collapse

Methods inherited from Base

#brand

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_yetObject (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

#countObject (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_prefixObject (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

#textObject (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

#callObject



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

Returns:

  • (Boolean)


18
19
20
# File 'app/components/govuk_component/task_list_component/status_component.rb', line 18

def render?
  status_text.present?
end