Module: MWO::CollectionUtils
- Defined in:
- lib/mwo/collection_utils.rb
Instance Method Summary collapse
Instance Method Details
#filter(options = {}) ⇒ Object
2 3 4 5 6 7 8 9 10 11 |
# File 'lib/mwo/collection_utils.rb', line 2 def filter( = {}) filtered = self.find_all do |element| matches = .find_all do |k,v| element.send(k) == [k] end !matches.empty? end filtered end |