lib/wildcard_matchers/matchers.rb in wildcard_matchers-0.0.2 vs lib/wildcard_matchers/matchers.rb in wildcard_matchers-0.0.3
- old
+ new
@@ -31,7 +31,13 @@
lambda do |hash|
(args - hash.keys).size == 0 &&
hash_to_match.all? {|key, value| value === hash[key] }
end
end
+
+ def is_a_member_of(*args)
+ lambda do |item|
+ args.flatten.any? {|expected| expected === item }
+ end
+ end
end
end