Skip to content

Instantly share code, notes, and snippets.

@fables-tales
Forked from jcoglan/procs.rb
Created April 29, 2015 22:15
Show Gist options
  • Save fables-tales/d47c67bfd9ec822bd340 to your computer and use it in GitHub Desktop.
Save fables-tales/d47c67bfd9ec822bd340 to your computer and use it in GitHub Desktop.
def foo(block)
p [:foo, 1]
block.call
p [:foo, 2]
end
def bar(block)
p [:bar, 1]
foo(block)
p [:bar, 2]
end
def baz
p [:baz, 1]
bar Proc.new { return }
p [:baz, 2]
end
baz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment