Method: Enumerable#subset_of?

Defined in:
lib/y_support/core_ext/enumerable/misc.rb

#subset_of?(other_collection) ⇒ Boolean Also known as: ⊂?

Checks whether the receiver collection is fully included in the collection supplied as an argument.

Returns:

  • (Boolean)


20
21
22
# File 'lib/y_support/core_ext/enumerable/misc.rb', line 20

def subset_of?( other_collection )
  all? {|e| other_collection.include? e }
end