Skip to content

Instantly share code, notes, and snippets.

@ngpestelos
Created September 20, 2013 13:23
Show Gist options
  • Save ngpestelos/6637480 to your computer and use it in GitHub Desktop.
Save ngpestelos/6637480 to your computer and use it in GitHub Desktop.
returning from a Proc
# see Metaprogramming Ruby, p. 80
def another_double
p = Proc.new { return 10 }
result = p.call
return result * 2 # will not pass here
end
puts another_double
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment