Class: Spotlight::BreadcrumbsComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Spotlight::BreadcrumbsComponent
- Defined in:
- app/components/spotlight/breadcrumbs_component.rb
Overview
Component to render breadcrumbs
Instance Attribute Summary collapse
-
#breadcrumbs ⇒ Object
readonly
Returns the value of attribute breadcrumbs.
Instance Method Summary collapse
-
#initialize(breadcrumbs: []) ⇒ BreadcrumbsComponent
constructor
A new instance of BreadcrumbsComponent.
- #path(path) ⇒ Object
- #render? ⇒ Boolean
Constructor Details
#initialize(breadcrumbs: []) ⇒ BreadcrumbsComponent
Returns a new instance of BreadcrumbsComponent.
8 9 10 11 |
# File 'app/components/spotlight/breadcrumbs_component.rb', line 8 def initialize(breadcrumbs: []) @breadcrumbs = super end |
Instance Attribute Details
#breadcrumbs ⇒ Object (readonly)
Returns the value of attribute breadcrumbs.
6 7 8 |
# File 'app/components/spotlight/breadcrumbs_component.rb', line 6 def @breadcrumbs end |
Instance Method Details
#path(path) ⇒ Object
17 18 19 20 21 |
# File 'app/components/spotlight/breadcrumbs_component.rb', line 17 def path(path) return path unless path.instance_of?(::Spotlight::Exhibit) helpers.exhibit_path(path) end |
#render? ⇒ Boolean
13 14 15 |
# File 'app/components/spotlight/breadcrumbs_component.rb', line 13 def render? !helpers.resource_masthead? && .present? end |