Home / Report Question

Q. What is the purpose of the Object#tap method in Ruby?
  • A. It evaluates a block of code within the context of the object
  • B. It allows you to perform operations on an object and return the object itself
  • C. It raises an exception if the object is nil
  • D. It evaluates a block of code within the context of the object

Correct Answer: B