Created
February 1, 2009 23:23
-
-
Save merbjedi/56695 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Symbol | |
def to_proc | |
Proc.new { |obj, *args| obj.send(self, *args) } | |
end | |
end | |
class Foo | |
def foo | |
:foo | |
end | |
end | |
@foos = [Foo.new] * 1_000_000 | |
@foos.each(&:foo) #with shorthand | |
# @foos.each{|f| f.foo} #without shorthand |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment