Created
May 6, 2011 20:50
-
-
Save swalberg/959755 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 Blah | |
def self.foo(&block) | |
bar | |
end | |
def bar(&block) | |
block.call("abc") | |
end | |
end | |
result = nil | |
Blah.foo {|r| result = r} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
class Blocky
def self.foo(&block)
self.bar(block)
end
def self.bar(block)
block.call("abc")
end
end
result = nil
Blocky.foo {|r| result = r}
puts result