Class: HotwireCombobox::Listbox::Option
- Inherits:
-
Object
- Object
- HotwireCombobox::Listbox::Option
- Defined in:
- app/presenters/hotwire_combobox/listbox/option.rb
Defined Under Namespace
Classes: Data
Instance Method Summary collapse
- #autocompletable_as ⇒ Object
-
#initialize(option) ⇒ Option
constructor
A new instance of Option.
- #render_in(view) ⇒ Object
- #value ⇒ Object
Constructor Details
Instance Method Details
#autocompletable_as ⇒ Object
16 17 18 |
# File 'app/presenters/hotwire_combobox/listbox/option.rb', line 16 def autocompletable_as option.try(:autocompletable_as) || option.try(:display) end |
#render_in(view) ⇒ Object
8 9 10 |
# File 'app/presenters/hotwire_combobox/listbox/option.rb', line 8 def render_in(view) view.tag.li content, ** end |
#value ⇒ Object
12 13 14 |
# File 'app/presenters/hotwire_combobox/listbox/option.rb', line 12 def value option.try(:value) || option.id end |