Class: UI::ContextMenuShortcut
- Inherits:
-
Phlex::HTML
- Object
- Phlex::HTML
- UI::ContextMenuShortcut
- Includes:
- ContextMenuShortcutBehavior
- Defined in:
- app/components/ui/context_menu_shortcut.rb
Overview
Shortcut - Phlex implementation
Displays keyboard shortcut text for a menu item. Uses ContextMenuShortcutBehavior concern for shared styling logic.
Instance Method Summary collapse
-
#initialize(classes: "", **attributes) ⇒ ContextMenuShortcut
constructor
A new instance of ContextMenuShortcut.
- #view_template(&block) ⇒ Object
Methods included from ContextMenuShortcutBehavior
#context_menu_shortcut_classes, #context_menu_shortcut_html_attributes
Constructor Details
#initialize(classes: "", **attributes) ⇒ ContextMenuShortcut
Returns a new instance of ContextMenuShortcut.
15 16 17 18 |
# File 'app/components/ui/context_menu_shortcut.rb', line 15 def initialize(classes: "", **attributes) @classes = classes @attributes = attributes end |
Instance Method Details
#view_template(&block) ⇒ Object
20 21 22 23 24 |
# File 'app/components/ui/context_menu_shortcut.rb', line 20 def view_template(&block) span(**.merge(@attributes)) do yield if block_given? end end |