lib/rbbt/tsv/manipulate.rb in rbbt-util-5.21.58 vs lib/rbbt/tsv/manipulate.rb in rbbt-util-5.21.59
- old
+ new
@@ -377,15 +377,15 @@
through do |key, value|
new[key] = value if invert ^ (method.include? key or method.include? value)
end
when :list, :flat
through do |key, values|
- new[key] = values if invert ^ (method.include? key or (method & values).any?)
+ new[key] = values if invert ^ (method.include? key or (method & values).length > 0)
end
else
through do |key, values|
- new[key] = values if invert ^ (method.include? key or (method & values.flatten).any?)
+ new[key] = values if invert ^ (method.include? key or (method & values.flatten).length > 0)
end
end
end
when Regexp === method
with_unnamed do
@@ -515,11 +515,11 @@
when String === method
with_unnamed do
through :key, key do |key, values|
values = [values] if type == :single
- new[key] = self[key] if invert ^ (values.flatten.select{|v| v == method}.any?)
+ new[key] = self[key] if invert ^ (values.flatten.select{|v| v == method}.length > 0)
end
end
when Fixnum === method
with_unnamed do
@@ -529,10 +529,10 @@
end
when Proc === method
with_unnamed do
through :key, key do |key, values|
values = [values] if type == :single
- new[key] = self[key] if invert ^ (values.flatten.select{|v| method.call(v)}.any?)
+ new[key] = self[key] if invert ^ (values.flatten.select{|v| method.call(v)}.length > 0)
end
end
end
end