Class: HotwireCombobox::Listbox::Group
- Inherits:
-
Object
- Object
- HotwireCombobox::Listbox::Group
- Defined in:
- app/presenters/hotwire_combobox/listbox/group.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(name, options:) ⇒ Group
constructor
A new instance of Group.
- #render_in(view) ⇒ Object
Constructor Details
#initialize(name, options:) ⇒ Group
Returns a new instance of Group.
6 7 8 9 |
# File 'app/presenters/hotwire_combobox/listbox/group.rb', line 6 def initialize(name, options:) @name = name @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
4 5 6 |
# File 'app/presenters/hotwire_combobox/listbox/group.rb', line 4 def @options end |
Instance Method Details
#render_in(view) ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'app/presenters/hotwire_combobox/listbox/group.rb', line 11 def render_in(view) view.tag.ul **group_attrs do view.concat view.tag.li(name, **label_attrs) .map do |option| view.concat view.render(option) end end end |