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

Methods inherited from Base

#brand, #class_prefix

Constructor Details

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

Returns a new instance of BreadcrumbsComponent.



4
5
6
7
8
9
10
11
12
13
14
15
16
17
# 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,
               inverse: false,
               classes: [],
               html_attributes: {})

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

  super(classes:, 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

#inverseObject (readonly)

Returns the value of attribute inverse.



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

def inverse
  @inverse
end