Class: UI::CommandComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- UI::CommandComponent
- Includes:
- CommandBehavior
- Defined in:
- app/view_components/ui/command_component.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(loop: true, autofocus: false, classes: "", **attributes) ⇒ CommandComponent
constructor
A new instance of CommandComponent.
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
#call ⇒ Object
13 14 15 |
# File 'app/view_components/ui/command_component.rb', line 13 def call content_tag(:div, content, **command_html_attributes.deep_merge(@attributes)) end |