Class: UI::Command

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

Returns a new instance of Command.



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

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

Instance Method Details

#view_templateObject



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

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