Elegant way to find items by criteria
forthrin opened this issue · 0 comments
forthrin commented
Thanks for making this library!
Is there a built-in search feature, ie. find the item with the best video resolution? Or at least a less clunky way than:
item = m3u8.items.max_by { |e| (e.respond_to?(:height) && e.height) || 0 }
Wouldn't it be simpler and better if the object returned was a symbol hash rather than an object with methods?