Skip to content

Instantly share code, notes, and snippets.

@worker8
Created October 16, 2012 06:57
Show Gist options
  • Select an option

  • Save worker8/3897641 to your computer and use it in GitHub Desktop.

Select an option

Save worker8/3897641 to your computer and use it in GitHub Desktop.
how they work
def proc_return
Proc.new { return "proc1"}.call
return "proc2 I AM HERE!"
end
def lambda_return
lambda { return "lambda1" }.call
return "lambda2 I AM HERE!"
end
def method_return
method(:func).call
return "method2 I AM HERE!"
end
def func
return "method1"
end
puts proc_return
puts lambda_return
puts method_return
#=== Result ===
proc1
lambda2 I AM HERE!
method2 I AM HERE!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment