Class: GovukComponent::BreadcrumbsComponent

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

Instance Attribute Summary collapse

Attributes inherited from Base

#html_attributes

Instance Method Summary collapse

Constructor Details

#initialize(breadcrumbs:, hide_in_print: config.default_breadcrumbs_hide_in_print, collapse_on_mobile: config.default_breadcrumbs_collapse_on_mobile, classes: [], html_attributes: {}) ⇒ BreadcrumbsComponent

Returns a new instance of BreadcrumbsComponent.



4
5
6
7
8
9
10
11
12
13
14
15
# File 'app/components/govuk_component/breadcrumbs_component.rb', line 4

def initialize(breadcrumbs:,
               hide_in_print: config.default_breadcrumbs_hide_in_print,
               collapse_on_mobile: config.default_breadcrumbs_collapse_on_mobile,
               classes: [],
               html_attributes: {})

  @breadcrumbs        = build_list(breadcrumbs)
  @hide_in_print      = hide_in_print
  @collapse_on_mobile = collapse_on_mobile

  super(classes: classes, html_attributes: html_attributes)
end

Instance Attribute Details

Returns the value of attribute breadcrumbs.



2
3
4
# File 'app/components/govuk_component/breadcrumbs_component.rb', line 2

def breadcrumbs
  @breadcrumbs
end

#collapse_on_mobileObject (readonly)

Returns the value of attribute collapse_on_mobile.



2
3
4
# File 'app/components/govuk_component/breadcrumbs_component.rb', line 2

def collapse_on_mobile
  @collapse_on_mobile
end

#hide_in_printObject (readonly)

Returns the value of attribute hide_in_print.



2
3
4
# File 'app/components/govuk_component/breadcrumbs_component.rb', line 2

def hide_in_print
  @hide_in_print
end