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