Class: PhlexUI::Select::Item

Inherits:
Base
  • Object
show all
Defined in:
lib/phlex_ui/select/item.rb

Instance Attribute Summary

Attributes inherited from Base

#attrs

Instance Method Summary collapse

Methods inherited from Base

#before_template

Constructor Details

#initialize(value: nil, **attrs) ⇒ Item

Returns a new instance of Item.



5
6
7
8
# File 'lib/phlex_ui/select/item.rb', line 5

def initialize(value: nil, **attrs)
  @value = value
  super(**attrs)
end

Instance Method Details

#view_template(&block) ⇒ Object



10
11
12
13
14
15
# File 'lib/phlex_ui/select/item.rb', line 10

def view_template(&block)
  div(**attrs) do
    block&.call
    selected_icon
  end
end