Class: UI::NavigationMenuItemComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- UI::NavigationMenuItemComponent
- Includes:
- NavigationMenuItemBehavior
- Defined in:
- app/view_components/ui/navigation_menu_item_component.rb
Overview
ItemComponent - ViewComponent implementation
Wrapper for individual navigation menu item.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(value: nil, classes: "", **attributes) ⇒ NavigationMenuItemComponent
constructor
A new instance of NavigationMenuItemComponent.
Methods included from NavigationMenuItemBehavior
#navigation_menu_item_classes, #navigation_menu_item_data_attributes, #navigation_menu_item_html_attributes
Constructor Details
#initialize(value: nil, classes: "", **attributes) ⇒ NavigationMenuItemComponent
Returns a new instance of NavigationMenuItemComponent.
12 13 14 15 16 |
# File 'app/view_components/ui/navigation_menu_item_component.rb', line 12 def initialize(value: nil, classes: "", **attributes) @value = value @classes = classes @attributes = attributes end |
Instance Method Details
#call ⇒ Object
18 19 20 21 22 |
# File 'app/view_components/ui/navigation_menu_item_component.rb', line 18 def call content_tag :li, **.deep_merge(@attributes) do content end end |