Vidyalelo
Ruby Programming · Q9

Blocks and Procs in Ruby

Programming · Ruby Programming · question 9

Q9

What does the & operator do when used with a proc in Ruby?

A.
Invokes the proc with the given arguments
B.
Converts the proc into a lambda so it can be passed to a method that expects a lambda parameter
C.
Converts the proc into a block so it can be passed to a method that expects a block parameter
Answer
D.
Converts the proc into a method so it can be called directly

Answer: Option C

Solution

Answer: Option C
No explanation is given for this question Let's Discuss on Board