モジュール内で、関係ないモジュールのクラスを定義してもいいんですね。 まぁ、やらん方がいいとは思うけど。
1 module Foo 2 end 3 4 module Baz 5 class ::Foo::Bar6 def xyzzy 7 'hoge' 8 end 9 end 10 end 11 12 Foo::Bar.new.xyzzy #=> 'hoge'
posted by
technohippy
on Tue 5 Aug 2008
at 20:43