Class: UI::CommandItemComponent

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

Instance Method Summary collapse

Methods included from CommandItemBehavior

#command_item_classes, #command_item_data_attributes, #command_item_html_attributes

Constructor Details

#initialize(value: nil, disabled: false, classes: "", **attributes) ⇒ CommandItemComponent

Returns a new instance of CommandItemComponent.



6
7
8
9
10
11
# File 'app/view_components/ui/command_item_component.rb', line 6

def initialize(value: nil, disabled: false, classes: "", **attributes)
  @value = value
  @disabled = disabled
  @classes = classes
  @attributes = attributes
end

Instance Method Details

#callObject



13
14
15
# File 'app/view_components/ui/command_item_component.rb', line 13

def call
  (:div, content, **command_item_html_attributes.deep_merge(@attributes))
end