Sha256: 072ae19c952e2c4932956803fdb29a24a82483f13d93d10e5656caad3e8d03a0
Contents?: true
Size: 631 Bytes
Versions: 34
Compression:
Stored size: 631 Bytes
Contents
module Bmg module TupleAlgebra def allbut(tuple, butlist) tuple.reject{|k,v| butlist.include?(k) } end module_function :allbut def project(tuple, attrlist) tuple.reject{|k,v| !attrlist.include?(k) } end module_function :project def rename(tuple, renaming) tuple.each_with_object({}){|(k,v),m| m[renaming[k] || k] = v m } end module_function :rename def symbolize_keys(h) return h if h.empty? h.each_with_object({}){|(k,v),h| h[k.to_sym] = v } end module_function :symbolize_keys end # module TupleAlgebra end # module Bmg
Version data entries
34 entries across 34 versions & 1 rubygems