Class: DesignSystem::Generic::BreadcrumbsComponent

Inherits:
BaseComponent
  • Object
show all
Defined in:
app/components/design_system/generic/breadcrumbs_component.rb

Overview

Breadcrumb trail rendered into the :breadcrumbs content_for slot by the fixed-elements builder. Brands own the markup via their own templates.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helpers::CssHelper

#css_class_options_merge

Methods included from BrandDerivable

#brand

Constructor Details

#initialize(breadcrumbs:) ⇒ BreadcrumbsComponent

Returns a new instance of BreadcrumbsComponent.



6
7
8
9
# File 'app/components/design_system/generic/breadcrumbs_component.rb', line 6

def initialize(breadcrumbs:)
  super()
  @breadcrumbs = breadcrumbs
end

Instance Attribute Details

Returns the value of attribute breadcrumbs.



11
12
13
# File 'app/components/design_system/generic/breadcrumbs_component.rb', line 11

def breadcrumbs
  @breadcrumbs
end

Instance Method Details

#current_page_aria(breadcrumb) ⇒ Object



13
14
15
# File 'app/components/design_system/generic/breadcrumbs_component.rb', line 13

def current_page_aria(breadcrumb)
  helpers.current_page?(breadcrumb[:path]) ? 'page' : nil
end