Class: PhlexKit::CommandItem
- Inherits:
-
BaseComponent
- Object
- Phlex::HTML
- BaseComponent
- PhlexKit::CommandItem
- Defined in:
- app/components/phlex_kit/command/command_item.rb
Overview
Instance Method Summary collapse
-
#initialize(value:, text: "", href: "#", **attrs) ⇒ CommandItem
constructor
A new instance of CommandItem.
- #view_template ⇒ Object
Methods inherited from BaseComponent
Constructor Details
#initialize(value:, text: "", href: "#", **attrs) ⇒ CommandItem
Returns a new instance of CommandItem.
6 7 8 9 10 11 |
# File 'app/components/phlex_kit/command/command_item.rb', line 6 def initialize(value:, text: "", href: "#", **attrs) @value = value @text = text @href = href @attrs = attrs end |
Instance Method Details
#view_template ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'app/components/phlex_kit/command/command_item.rb', line 13 def view_template(&) a(**mix({ class: "pk-command-item", href: @href, role: "option", data: { phlex_kit__command_target: "item", value: @value, text: @text } }, @attrs), &) end |