Class: Primer::UnderlineNavComponent
- Defined in:
- app/components/primer/underline_nav_component.rb
Constant Summary collapse
- ALIGN_DEFAULT =
:left- ALIGN_OPTIONS =
[ALIGN_DEFAULT, :right]
Constants included from FetchOrFallbackHelper
FetchOrFallbackHelper::InvalidValueError
Instance Method Summary collapse
-
#initialize(align: ALIGN_DEFAULT, **system_arguments) ⇒ UnderlineNavComponent
constructor
A new instance of UnderlineNavComponent.
Methods included from JoinStyleArgumentsHelper
Methods included from FetchOrFallbackHelper
#fetch_or_fallback, #fetch_or_fallback_boolean
Methods included from ClassNameHelper
Constructor Details
#initialize(align: ALIGN_DEFAULT, **system_arguments) ⇒ UnderlineNavComponent
Returns a new instance of UnderlineNavComponent.
10 11 12 13 14 15 16 17 18 19 20 |
# File 'app/components/primer/underline_nav_component.rb', line 10 def initialize(align: ALIGN_DEFAULT, **system_arguments) @align = fetch_or_fallback(ALIGN_OPTIONS, align, ALIGN_DEFAULT) @system_arguments = system_arguments @system_arguments[:tag] = :nav @system_arguments[:classes] = class_names( @system_arguments[:classes], "UnderlineNav", "UnderlineNav--right" => @align == :right ) end |