Created
August 7, 2014 01:17
-
-
Save fdelacruz/a786424aff01a76d0935 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| proc = Proc.new { |x| puts x } # creates a proc that takes 1 argument | |
| proc.call(2) # prints out 2 | |
| proc.call # returns nil | |
| proc.call(1,2,3) # prints out 1 and forgets about the extra arguments |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment