When defining more than one method within a class using a proc that returns __method__ all methods will return the symbol representing the last defined method:
DEFINITION = proc { __method__ }
class C
define_method :one, DEFINITION
define_method :two, DEFINITION
end
o = C.new
puts o.one #=> :two (in MRI this returns :one)
puts o.two #=> :two
Casting DEFINITION into a code block during the method's definition seems to be working correctly though:
class C
define_method :one, &DEFINITION
define_method :two, &DEFINITION
end
o = C.new
puts o.one #=> :one
puts o.two #=> :two
A lengthier description of the problem can be found at this post in Stack Overflow.