Skip to content

Instantly share code, notes, and snippets.

@sarcilav
Forked from abuiles/gist:2138387
Created March 20, 2012 17:36
Show Gist options
  • Save sarcilav/2138478 to your computer and use it in GitHub Desktop.
Save sarcilav/2138478 to your computer and use it in GitHub Desktop.
a = Proc.new{ |*args| puts *args }
def foo(*args)
if block_given?
yield *args
end
end
foo(1, 2, &a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment