Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
def missing_arguments(block)'arg1', 'arg2')
a_proc = { |a, b, c| "a_proc outputs #{a} & #{b} & #{c}" }
a_lambda = lambda { |a, b, c| "a_lambda output #{a} & #{b} & #{c}" }
puts missing_arguments(a_proc)
puts missing_arguments(a_lambda)
Copy link

jenny-codes commented Apr 1, 2019


a_proc outputs arg1 & arg2 &
Traceback (most recent call last):
	2: from block.rb:40:in `<main>'
	1: from block.rb:33:in `missing_arguments'
proc_lambda_argument.rb:37:in `block in <main>': wrong number of arguments (given 2, expected 3) (ArgumentError)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment