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

Attributes included from Traits::CustomHtmlAttributes

#html_attributes

Instance Method Summary collapse

Methods included from Traits::CustomClasses

#classes

Methods included from Govuk::Components::Helpers::CssUtilities

#combine_classes

Constructor Details

#initialize(breadcrumbs:, hide_in_print: false, collapse_on_mobile: false, classes: [], html_attributes: {}) ⇒ BreadcrumbsComponent

Returns a new instance of BreadcrumbsComponent.



4
5
6
7
8
9
10
# File 'app/components/govuk_component/breadcrumbs_component.rb', line 4

def initialize(breadcrumbs:, hide_in_print: false, collapse_on_mobile: false, classes: [], html_attributes: {})
  super(classes: classes, html_attributes: html_attributes)

  @breadcrumbs        = build_list(breadcrumbs)
  @hide_in_print      = hide_in_print
  @collapse_on_mobile = collapse_on_mobile
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