Class: UI::ContextMenuLabelComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- UI::ContextMenuLabelComponent
- Includes:
- ContextMenuLabelBehavior
- Defined in:
- app/view_components/ui/context_menu_label_component.rb
Overview
LabelComponent - ViewComponent implementation
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(inset: false, classes: "", **attributes) ⇒ ContextMenuLabelComponent
constructor
A new instance of ContextMenuLabelComponent.
Methods included from ContextMenuLabelBehavior
#context_menu_label_classes, #context_menu_label_data_attributes, #context_menu_label_html_attributes
Constructor Details
#initialize(inset: false, classes: "", **attributes) ⇒ ContextMenuLabelComponent
Returns a new instance of ContextMenuLabelComponent.
7 8 9 10 11 |
# File 'app/view_components/ui/context_menu_label_component.rb', line 7 def initialize(inset: false, classes: "", **attributes) @inset = inset @classes = classes @attributes = attributes end |
Instance Method Details
#call ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'app/view_components/ui/context_menu_label_component.rb', line 13 def call attrs = data_attrs = attrs.delete(:data) || {} data_attrs = data_attrs.merge(@attributes.fetch(:data, {})) content_tag :div, **attrs.merge(@attributes.except(:data)).merge(data: data_attrs) do content end end |