Class: GovukComponent::HeaderComponent

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

Defined Under Namespace

Classes: NavigationItem, ProductName

Instance Attribute Summary collapse

Attributes inherited from Base

#html_attributes

Instance Method Summary collapse

Methods inherited from Base

#brand, #class_prefix

Constructor Details

#initialize(classes: [], html_attributes: {}, homepage_url: config.default_header_homepage_url, menu_button_label: config.default_header_menu_button_label, navigation_classes: [], navigation_label: config.default_header_navigation_label, service_name: config.default_header_service_name, service_url: config.default_header_service_url, container_classes: nil, full_width_border: false) ⇒ HeaderComponent

Returns a new instance of HeaderComponent.



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'app/components/govuk_component/header_component.rb', line 15

def initialize(classes: [],
               html_attributes: {},
               homepage_url: config.default_header_homepage_url,
               menu_button_label: config.default_header_menu_button_label,
               navigation_classes: [],
               navigation_label: config.default_header_navigation_label,
               service_name: config.default_header_service_name,
               service_url: config.default_header_service_url,
               container_classes: nil,
               full_width_border: false)

  @homepage_url              = homepage_url
  @service_name              = service_name
  @service_url               = service_url
  @menu_button_label         = menu_button_label
  @custom_navigation_classes = navigation_classes
  @navigation_label          = navigation_label
  @custom_container_classes  = container_classes
  @full_width_border         = full_width_border

  super(classes:, html_attributes:)
end

Instance Attribute Details

#custom_container_classesObject (readonly)

Returns the value of attribute custom_container_classes.



6
7
8
# File 'app/components/govuk_component/header_component.rb', line 6

def custom_container_classes
  @custom_container_classes
end

#custom_navigation_classesObject (readonly)

Returns the value of attribute custom_navigation_classes.



6
7
8
# File 'app/components/govuk_component/header_component.rb', line 6

def custom_navigation_classes
  @custom_navigation_classes
end

#full_width_borderObject (readonly)

Returns the value of attribute full_width_border.



6
7
8
# File 'app/components/govuk_component/header_component.rb', line 6

def full_width_border
  @full_width_border
end

#homepage_urlObject (readonly)

Returns the value of attribute homepage_url.



6
7
8
# File 'app/components/govuk_component/header_component.rb', line 6

def homepage_url
  @homepage_url
end

Returns the value of attribute menu_button_label.



6
7
8
# File 'app/components/govuk_component/header_component.rb', line 6

def menu_button_label
  @menu_button_label
end

Returns the value of attribute navigation_label.



6
7
8
# File 'app/components/govuk_component/header_component.rb', line 6

def navigation_label
  @navigation_label
end

#service_nameObject (readonly)

Returns the value of attribute service_name.



6
7
8
# File 'app/components/govuk_component/header_component.rb', line 6

def service_name
  @service_name
end

#service_urlObject (readonly)

Returns the value of attribute service_url.



6
7
8
# File 'app/components/govuk_component/header_component.rb', line 6

def service_url
  @service_url
end