Class: UI::CommandItem

Inherits:
Phlex::HTML
  • Object
show all
Includes:
CommandItemBehavior
Defined in:
app/components/ui/command_item.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) ⇒ CommandItem

Returns a new instance of CommandItem.



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

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

Instance Method Details

#view_templateObject



13
14
15
# File 'app/components/ui/command_item.rb', line 13

def view_template(&)
  div(**command_item_html_attributes.deep_merge(@attributes), &)
end