Class: PhlexKit::ContextMenuSeparator
- Inherits:
-
BaseComponent
- Object
- Phlex::HTML
- BaseComponent
- PhlexKit::ContextMenuSeparator
- Defined in:
- app/components/phlex_kit/context_menu/context_menu_separator.rb
Instance Method Summary collapse
-
#initialize(**attrs) ⇒ ContextMenuSeparator
constructor
A new instance of ContextMenuSeparator.
- #view_template ⇒ Object
Methods inherited from BaseComponent
Constructor Details
#initialize(**attrs) ⇒ ContextMenuSeparator
Returns a new instance of ContextMenuSeparator.
3 |
# File 'app/components/phlex_kit/context_menu/context_menu_separator.rb', line 3 def initialize(**attrs) = (@attrs = attrs) |
Instance Method Details
#view_template ⇒ Object
4 5 6 7 8 9 10 11 |
# File 'app/components/phlex_kit/context_menu/context_menu_separator.rb', line 4 def view_template base = { class: "pk-context-menu-separator" } # Defaults only when the caller didn't supply their own — `mix` fuses, # and aria_key_set? covers the aria: hash spelling the flat key missed. base[:role] = "separator" unless attr_set?(:role) base[:"aria-orientation"] = "horizontal" unless aria_key_set?(:orientation) div(**mix(base, @attrs)) end |