Vidyalelo
Ruby Programming · Q10

Blocks and Procs in Ruby

Programming · Ruby Programming · question 10

Q10

What is the purpose of using blocks and procs in Ruby?

A.
To create new instances of classes
B.
To encapsulate and pass around chunks of code
Answer
C.
To handle file input and output
D.
None of the above

Answer: Option B

Solution

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