5th Tue
クラス定義
モジュール内で、関係ないモジュールのクラスを定義してもいいんですね。
まぁ、やらん方がいいとは思うけど。
ruby>>
module Foo
end
module Baz
class ::Foo::Bar
def xyzzy
'hoge'
end
end
end
Foo::Bar.new.xyzzy #=> 'hoge'
<<ruby
posted by
technohippy on Tue 5 Aug 2008 at 20:40 with 0 comments