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