Skip to content

Instantly share code, notes, and snippets.

@jaredatron
Created April 28, 2009 22:35
Show Gist options
  • Save jaredatron/103444 to your computer and use it in GitHub Desktop.
Save jaredatron/103444 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'activesupport'
class Array
def to_proc
procs = self.clone
lambda { |object, *args|
procs.inject(object){ |object, proc|
proc.to_proc.call(object, *args)
}
}
end
end
puts ['hello', 'there'].map(&[:upcase, :reverse])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment