lib/raingrams/ngram.rb in raingrams-0.1.0 vs lib/raingrams/ngram.rb in raingrams-0.1.1
- old
+ new
@@ -68,11 +68,15 @@
def include?(obj)
super(obj.to_gram)
end
- def includes?(*grams)
- (self & grams) == grams
+ def includes_any?(*grams)
+ grams.any? { |gram| include?(gram) }
+ end
+
+ def includes_all?(*grams)
+ grams.all? { |gram| include?(gram) }
end
def flatten
self.dup
end