Skip to content

Instantly share code, notes, and snippets.

@fdelacruz
Created August 7, 2014 01:17
Show Gist options
  • Select an option

  • Save fdelacruz/a786424aff01a76d0935 to your computer and use it in GitHub Desktop.

Select an option

Save fdelacruz/a786424aff01a76d0935 to your computer and use it in GitHub Desktop.
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