Module: ActivePStore::QueryMethods
- Included in:
- Base
- Defined in:
- lib/active_pstore/query_methods.rb
Instance Method Summary collapse
Instance Method Details
#where(conditions = {}) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/active_pstore/query_methods.rb', line 3 def where(conditions = {}) ret = all return ret if conditions.empty? conditions.each do |key, value| ret = ret.select {|obj| if value.is_a? Range value.include?(obj.__send__(key)) else obj.__send__(key) == value end } end ActivePStore::Collection.new(ret) end |