Class: RubyUI::SelectValue
- Defined in:
- lib/ruby_ui/select/select_value.rb
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(placeholder: nil, **attrs) ⇒ SelectValue
constructor
A new instance of SelectValue.
- #view_template(&block) ⇒ Object
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 |