Sha256: f3042a88a6bbea027b7e04288f7d34c96aeab7223ab21945112f7a2c4a4c4236
Contents?: true
Size: 338 Bytes
Versions: 8
Compression:
Stored size: 338 Bytes
Contents
class HotwireCombobox::Listbox::Item::Collection < Array def find_by_value(value) if grouped? flat_map { |item| item.options }.find { |option| option.value == value } else find { |option| option.value == value } end end private def grouped? first.is_a? HotwireCombobox::Listbox::Group end end
Version data entries
8 entries across 8 versions & 1 rubygems