Sha256: 4c44b4bf46654d78283342a068d9db11dd71aadcddf9fda19248ae0d8d4f8591
Contents?: true
Size: 802 Bytes
Versions: 11
Compression:
Stored size: 802 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
11 entries across 11 versions & 1 rubygems