Class: Primer::BreadcrumbComponent::BreadcrumbItem
- Defined in:
- app/components/primer/breadcrumb_component.rb
Overview
_Note: if both ‘href` and `selected: true` are passed in, `href` will be ignored and the item will not be rendered as a link._
Constant Summary
Constants included from FetchOrFallbackHelper
FetchOrFallbackHelper::InvalidValueError
Instance Attribute Summary collapse
-
#href ⇒ Object
readonly
Returns the value of attribute href.
-
#system_arguments ⇒ Object
readonly
Returns the value of attribute system_arguments.
Instance Method Summary collapse
-
#initialize(href: nil, selected: false, **system_arguments) ⇒ BreadcrumbItem
constructor
A new instance of BreadcrumbItem.
Methods included from JoinStyleArgumentsHelper
Methods included from FetchOrFallbackHelper
#fetch_or_fallback, #fetch_or_fallback_boolean
Methods included from ClassNameHelper
Constructor Details
#initialize(href: nil, selected: false, **system_arguments) ⇒ BreadcrumbItem
Returns a new instance of BreadcrumbItem.
35 36 37 38 39 40 41 42 43 |
# File 'app/components/primer/breadcrumb_component.rb', line 35 def initialize(href: nil, selected: false, **system_arguments) @href = href @system_arguments = system_arguments @href = nil if selected @system_arguments[:tag] = :li @system_arguments[:"aria-current"] = "page" if selected @system_arguments[:classes] = "breadcrumb-item #{@system_arguments[:classes]}" end |
Instance Attribute Details
#href ⇒ Object (readonly)
Returns the value of attribute href.
30 31 32 |
# File 'app/components/primer/breadcrumb_component.rb', line 30 def href @href end |
#system_arguments ⇒ Object (readonly)
Returns the value of attribute system_arguments.
30 31 32 |
# File 'app/components/primer/breadcrumb_component.rb', line 30 def system_arguments @system_arguments end |