Skip to content

Instantly share code, notes, and snippets.

@swalberg
Created May 6, 2011 20:50
Show Gist options
  • Save swalberg/959755 to your computer and use it in GitHub Desktop.
Save swalberg/959755 to your computer and use it in GitHub Desktop.
class Blah
def self.foo(&block)
bar
end
def bar(&block)
block.call("abc")
end
end
result = nil
Blah.foo {|r| result = r}
@marcjeanson
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment