Created
September 20, 2013 05:50
-
-
Save jhamon/6633763 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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