Class: RubyUI::SelectValue

Inherits:
Base
  • Object
show all
Defined in:
lib/ruby_ui/select/select_value.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(placeholder: nil, **attrs) ⇒ SelectValue

Returns a new instance of SelectValue.



5
6
7
8
# File 'lib/ruby_ui/select/select_value.rb', line 5

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

Instance Method Details

#view_template(&block) ⇒ Object



10
11
12
13
14
# File 'lib/ruby_ui/select/select_value.rb', line 10

def view_template(&block)
  span(**attrs) do
    block ? block.call : @placeholder
  end
end