Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumRubyrefinements usingSingle-choice MCQ

Refinements are lexically scoped. Given `using Ext` at the top level, what happens when `Calc#run` (defined before `using`) indirectly calls a refined method?

module Ext refine Integer do def double; self * 2; end end end class Calc def run(n) = helper(n) def helper(n) = n.double end using Ext p 5.double p Calc.new.run(5)