Sha256: 794b5612d1b5306063f8ecef54ee2d9a585324fa88f1b91b5b810926ce40dacc
Contents?: true
Size: 377 Bytes
Versions: 10
Compression:
Stored size: 377 Bytes
Contents
class Module # Prepend an +aspect+ module to a module. # This only works at the module level. # # module X # def x; "x"; end # end # # module U # def x; '{' + super + '}'; end # end # # X.prepend U # # X.x # => "{x}" # # CREDIT Trans def prepend(aspect) aspect.__send__(:include, self) extend aspect end end
Version data entries
10 entries across 10 versions & 1 rubygems