Sha256: a68c3590af18d09d626f8669ac58497a950edbfc9406fd22c25c4cf43b6138ee

Contents?: true

Size: 801 Bytes

Versions: 47

Compression:

Stored size: 801 Bytes

Contents

#encoding: utf-8

module Enumerable
  # Checks whether #all? collection elements are #kind_of? module
  # supplied as an argument
  # 
  def all_kind_of?( kind )
    all? {|e| e.kind_of? kind }
  end
  
  # Checks whether #all? collection elements are #kind_of? Numeric.
  # 
  def all_numeric?
    all? {|e| e.kind_of? Numeric }
  end
  
  # Checks whether the receiver collection is fully included in the
  # collection supplied as an argument.
  # 
  def subset_of?( other_collection )
    all? {|e| other_collection.include? e }
  end
  alias :⊂? :subset_of?
  
  # Checks whether the receiver collection contains every element of
  # the collection supplied as an argument.
  # 
  def superset_of?( other_collection )
    other.all? {|e| self.include? e }
  end
  alias :⊃? :superset_of?
end

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
y_support-2.1.5 lib/y_support/core_ext/enumerable/misc.rb
y_support-2.1.4 lib/y_support/core_ext/enumerable/misc.rb
y_support-2.1.3 lib/y_support/core_ext/enumerable/misc.rb
y_support-2.1.2 lib/y_support/core_ext/enumerable/misc.rb
y_support-2.1.1 lib/y_support/core_ext/enumerable/misc.rb
y_support-2.1.0 lib/y_support/core_ext/enumerable/misc.rb
y_support-2.0.43 lib/y_support/core_ext/enumerable/misc.rb
y_support-2.0.42 lib/y_support/core_ext/enumerable/misc.rb
y_support-2.0.41 lib/y_support/core_ext/enumerable/misc.rb
y_support-2.0.39 lib/y_support/core_ext/enumerable/misc.rb
y_support-2.0.38 lib/y_support/core_ext/enumerable/misc.rb
y_support-2.0.37 lib/y_support/core_ext/enumerable/misc.rb
y_support-2.0.36 lib/y_support/core_ext/enumerable/misc.rb
y_support-2.0.35 lib/y_support/core_ext/enumerable/misc.rb
y_support-2.0.34 lib/y_support/core_ext/enumerable/misc.rb
y_support-2.0.33 lib/y_support/core_ext/enumerable/misc.rb
y_support-2.0.31 lib/y_support/core_ext/enumerable/misc.rb
y_support-2.0.30 lib/y_support/core_ext/enumerable/misc.rb
y_support-2.0.29 lib/y_support/core_ext/enumerable/misc.rb
y_support-2.0.28 lib/y_support/core_ext/enumerable/misc.rb