Class: RubyUI::SelectItem

Inherits:
Base
  • Object
show all
Defined in:
lib/ruby_ui/select/select_item.rb

Constant Summary

Constants inherited from Base

Base::TAILWIND_MERGER

Instance Attribute Summary

Attributes inherited from Base

#attrs

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of SelectItem.



5
6
7
8
# File 'lib/ruby_ui/select/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/ruby_ui/select/select_item.rb', line 10

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