Class: Sift::SubsetComparator
- Inherits:
-
Object
- Object
- Sift::SubsetComparator
- Defined in:
- lib/sift/subset_comparator.rb
Instance Method Summary collapse
- #include?(other) ⇒ Boolean
-
#initialize(array) ⇒ SubsetComparator
constructor
A new instance of SubsetComparator.
Constructor Details
#initialize(array) ⇒ SubsetComparator
Returns a new instance of SubsetComparator.
3 4 5 |
# File 'lib/sift/subset_comparator.rb', line 3 def initialize(array) @array = array end |
Instance Method Details
#include?(other) ⇒ Boolean
7 8 9 10 11 |
# File 'lib/sift/subset_comparator.rb', line 7 def include?(other) other = [other] unless other.is_a?(Array) @array.to_set >= other.to_set end |