lib/heliodor/query_internal.rb in heliodor-0.1.1 vs lib/heliodor/query_internal.rb in heliodor-0.1.2
- old
+ new
@@ -14,17 +14,17 @@
end
def _select(dat = {})
out = []
@dat.each do |item|
- out << item if (v.class == Hash) && (item >= dat)
+ out << item if item.class.ancestors.include?(Hash) && item >= dat
end
@dat = out
end
- def _update(dat1 = {}, dat2 = {})
+ def _update(_dat1 = {}, dat2 = {})
@dat.each_with_index do |v, k|
- @dat[k] = v.merge(dat2) if (v.class == Hash) && (v >= dat1)
+ @dat[k] = v.merge(dat2) if v.class.ancestors.include?(Hash) && v >= dat
end
end
def _map(&_block)
@dat.each_with_index do |v, k|