Vidyalelo
Ruby Programming · Q12

Blocks and Procs in Ruby

Programming · Ruby Programming · question 12

Q12

What happens if a block is passed to a method that doesn't expect one in Ruby?

A.
It silently ignores the block
B.
It converts the block into a proc and passes it as an argument
C.
It converts the block into a lambda and passes it as an argument
D.
It raises an error
Answer

Answer: Option D

Solution

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