Method: Primer::Alpha::Dropdown::Menu#initialize
- Defined in:
- app/components/primer/alpha/dropdown/menu.rb
permalink #initialize(as: AS_DEFAULT, direction: DIRECTION_DEFAULT, scheme: SCHEME_DEFAULT, header: nil, **system_arguments) ⇒ Menu
Returns a new instance of Menu.
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'app/components/primer/alpha/dropdown/menu.rb', line 34 def initialize(as: AS_DEFAULT, direction: DIRECTION_DEFAULT, scheme: SCHEME_DEFAULT, header: nil, **system_arguments) @header = header @direction = direction @as = fetch_or_fallback(AS_OPTIONS, as, AS_DEFAULT) @system_arguments = deny_tag_argument(**system_arguments) @system_arguments[:tag] = "details-menu" @system_arguments[:role] = "menu" @system_arguments[:classes] = class_names( @system_arguments[:classes], "dropdown-menu", "dropdown-menu-#{fetch_or_fallback(DIRECTION_OPTIONS, direction, DIRECTION_DEFAULT)}", SCHEME_MAPPINGS[fetch_or_fallback(SCHEME_MAPPINGS.keys, scheme, SCHEME_DEFAULT)] ) end |