Skip to content

Instantly share code, notes, and snippets.

@zwily
Created October 18, 2010 21:14
Show Gist options
  • Save zwily/633072 to your computer and use it in GitHub Desktop.
Save zwily/633072 to your computer and use it in GitHub Desktop.
module Enumerable
def supermap(*args, &block)
res = []
self.each do |e|
arr = []
args.each { |a| arr << e.send(a) }
arr << block.call(e) if block
res << arr
end
res
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment