Class: UI::DropdownMenuLabelComponent

Inherits:
ViewComponent::Base
  • Object
show all
Includes:
DropdownMenuLabelBehavior
Defined in:
app/view_components/ui/dropdown_menu_label_component.rb

Overview

LabelComponent - ViewComponent implementation

Instance Method Summary collapse

Methods included from DropdownMenuLabelBehavior

#dropdown_menu_label_classes, #dropdown_menu_label_data_attributes, #dropdown_menu_label_html_attributes

Constructor Details

#initialize(inset: false, classes: "", **attributes) ⇒ DropdownMenuLabelComponent

Returns a new instance of DropdownMenuLabelComponent.



7
8
9
10
11
# File 'app/view_components/ui/dropdown_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
# File 'app/view_components/ui/dropdown_menu_label_component.rb', line 13

def call
   :div, **dropdown_menu_label_html_attributes.merge(@attributes.except(:data)) do
    content
  end
end