The scope of the refinement is limited by the current context. Since refinements are not global, unlike monkey patches, any attempt to name the cleaned method from the outside is prevented. In the code below:
puts [[1, 2, 3]].map { |array| array.sum } # => 6
the scope is beautiful, we are inside the same area where this refinement was defined. But here:
puts [[1, 2, 3]].map(&:sum)
the scope is transferred to the class context Symbol
(!). As stated in the documentation:
, .
. , , , , . , . :)
P.S. !