Class: PhlexUI::Select::Value
- Defined in:
- lib/phlex_ui/select/value.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(placeholder: nil, **attrs) ⇒ Value
constructor
A new instance of Value.
- #view_template(&block) ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(placeholder: nil, **attrs) ⇒ Value
Returns a new instance of Value.
5 6 7 8 |
# File 'lib/phlex_ui/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/phlex_ui/select/value.rb', line 10 def view_template(&block) span(**attrs) do block ? block.call : @placeholder end end |