Sha256: 76737709f55b4b2bc5439ae7e3b15f6efb7e9a4ff98d52aa9cc7194a06647dfd
Contents?: true
Size: 239 Bytes
Versions: 9
Compression:
Stored size: 239 Bytes
Contents
class Hash def subset keys = nil, &block h = {} if keys self.each do |k, v| h[k] = v if keys.include? k end else self.each do |k, v| h[k] = v if block.call k end end h end end
Version data entries
9 entries across 9 versions & 2 rubygems