Class: MaquinaComponents::DropdownMenuHelper::DropdownMenuItemBuilder
- Inherits:
-
Object
- Object
- MaquinaComponents::DropdownMenuHelper::DropdownMenuItemBuilder
- Defined in:
- app/helpers/maquina_components/dropdown_menu_helper.rb
Overview
Builder for individual menu items (supports shortcuts)
Instance Attribute Summary collapse
-
#shortcut_html ⇒ Object
readonly
Returns the value of attribute shortcut_html.
Instance Method Summary collapse
-
#initialize(view_context) ⇒ DropdownMenuItemBuilder
constructor
A new instance of DropdownMenuItemBuilder.
-
#shortcut(text) ⇒ Object
Adds a keyboard shortcut.
Constructor Details
#initialize(view_context) ⇒ DropdownMenuItemBuilder
Returns a new instance of DropdownMenuItemBuilder.
236 237 238 239 |
# File 'app/helpers/maquina_components/dropdown_menu_helper.rb', line 236 def initialize(view_context) @view = view_context @shortcut_html = nil end |
Instance Attribute Details
#shortcut_html ⇒ Object (readonly)
Returns the value of attribute shortcut_html.
234 235 236 |
# File 'app/helpers/maquina_components/dropdown_menu_helper.rb', line 234 def shortcut_html @shortcut_html end |
Instance Method Details
#shortcut(text) ⇒ Object
Adds a keyboard shortcut
244 245 246 |
# File 'app/helpers/maquina_components/dropdown_menu_helper.rb', line 244 def shortcut(text) @shortcut_html = @view.render("components/dropdown_menu/shortcut", text: text) end |