Class: UI::CommandComponent

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

Instance Method Summary collapse

Methods included from CommandBehavior

#command_classes, #command_data_attributes, #command_html_attributes

Constructor Details

#initialize(loop: true, autofocus: false, classes: "", **attributes) ⇒ CommandComponent

Returns a new instance of CommandComponent.



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

def initialize(loop: true, autofocus: false, classes: "", **attributes)
  @loop = loop
  @autofocus = autofocus
  @classes = classes
  @attributes = attributes
end

Instance Method Details

#callObject



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

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