Advanced Ruby
Q86 / 100

What is "Refinements" in Ruby and how do they relate to monkey patching?

Correct! Well done.

Incorrect.

The correct answer is B) Refinements allow scoped modifications to a class that only take effect within the lexical scope where "using" is called, avoiding the global side effects of traditional monkey patching

B

Correct Answer

Refinements allow scoped modifications to a class that only take effect within the lexical scope where "using" is called, avoiding the global side effects of traditional monkey patching

Explanation

Refinements (defined with refine, activated with using) provide a way to alter class behavior in a controlled, scoped manner, limiting the impact of changes compared to global monkey patches.

Progress
86/100