Class: UI::MenubarShortcut
- Inherits:
-
Phlex::HTML
- Object
- Phlex::HTML
- UI::MenubarShortcut
- Includes:
- MenubarShortcutBehavior
- Defined in:
- app/components/ui/menubar_shortcut.rb
Overview
Shortcut - Phlex implementation
Displays keyboard shortcut hint for menu items.
Instance Method Summary collapse
-
#initialize(classes: "", **attributes) ⇒ MenubarShortcut
constructor
A new instance of MenubarShortcut.
- #view_template(&block) ⇒ Object
Methods included from MenubarShortcutBehavior
#menubar_shortcut_classes, #menubar_shortcut_data_attributes, #menubar_shortcut_html_attributes
Constructor Details
#initialize(classes: "", **attributes) ⇒ MenubarShortcut
Returns a new instance of MenubarShortcut.
17 18 19 20 |
# File 'app/components/ui/menubar_shortcut.rb', line 17 def initialize(classes: "", **attributes) @classes = classes @attributes = attributes end |
Instance Method Details
#view_template(&block) ⇒ Object
22 23 24 25 26 |
# File 'app/components/ui/menubar_shortcut.rb', line 22 def view_template(&block) span(**.deep_merge(@attributes)) do yield if block_given? end end |