Announcement (2017-05-07): www.ruby-forum.com is now read-only since I
unfortunately do not have the time to support and maintain the forum any
more. Please see rubyonrails.org/community and ruby-lang.org/en/community
for other Rails- und Ruby-related community platforms.

Hello,
I'm trying to write a code similar to the below:
class Module
def foo(*names)
for name in names
class_eval do
define_method(name) do
puts name
end
end
end
end
end
class Goo
foo :a, :b, :c
end
I was expecting to
bar = Goo.new
bar.a prints 'a', bar.b prints 'b', and bar.c prints 'c'. But all
methods prints 'c'. Why?
Thanks!