Skip to content

Instantly share code, notes, and snippets.

@jhamon
Created September 20, 2013 05:50
Show Gist options
  • Save jhamon/6633763 to your computer and use it in GitHub Desktop.
Save jhamon/6633763 to your computer and use it in GitHub Desktop.
def mymethod2(prc)
puts "Hello from inside mymethod2."
puts "Calling the Proc object returns #{prc.call}"
end
prc = Proc.new { puts "I'm a proc." }
mymethod2(prc)
# Outputs:
# Hello from inside mymethod2.
# I'm a proc.
# Calling the Proc object returns
# => nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment