Module | Selectable |
In: |
lib/selectable.rb
lib/selectable/object.rb lib/selectable/tags.rb |
<strong>Note: Classes that include Selectable must also subclass Array</strong>
class Something < Array include Selectable end
Return the objects that match the given tags. This process is optimized for speed so there as few conditions as possible. One result of that decision is that it does not gracefully handle error conditions. For example, if the tags in an object have not been initialized, you will see this error:
undefined method `>=' for nil:NilClass
It also means you need be aware of the types of objects you are storing as values. If you store a Symbol, you must send a Symbol here.