From: Andy Bogdanov Date: 2011-03-14T05:10:20+09:00 Subject: can someone explain this? # First I create a proc: p = proc { self::X = Class.new def self.X X.new end } # Then I create a module: A = Module.new(&p) puts A.X # => # # Then i create another module: B = Module.new(&p) puts B.X # => # # Everything seems to be ok. # And now to the strange part. # After module B was created A.X started to return instances of B::X puts A.X # => # If more modules are created with the same proc method X returns instances of X from the last created module. If I use "self::X.new" instead of "X.new" everything works as expected, but I can't understand why it works like that with "X.new". Is this a bug or it's supposed to be this way? -- Posted via http://www.ruby-forum.com/.