Class: GovukComponent::TaskListComponent::TitleComponent

Inherits:
Base
  • Object
show all
Includes:
GovukLinkHelper, GovukVisuallyHiddenHelper
Defined in:
app/components/govuk_component/task_list_component/title_component.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#html_attributes

Instance Method Summary collapse

Methods included from GovukVisuallyHiddenHelper

#govuk_visually_hidden

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

#brand, #class_prefix

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

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

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

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

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

#callObject



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