• 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

モジュール内で、関係ないモジュールのクラスを定義してもいいんですね。 まぁ、やらん方がいいとは思うけど。

   1  module Foo
   2  end
   3  
   4  module Baz
   5    class ::Foo::Bar
   6      def xyzzy
   7        'hoge'
   8      end
   9    end
  10  end
  11  
  12  Foo::Bar.new.xyzzy #=> 'hoge'

posted by Png technohippy on Tue 5 Aug 2008 at 20:43

Comments:

or Preview
Social Bookmarks
  • Delicious
  • B_entry730
  • Clip_16_12_w
Services from s21g
twpro(ツイプロ)
Twitterプロフィールを快適検索
地価2009
土地の値段を調べてみよう
MyRestaurant
自分だけのレストラン手帳
Formula
ブログに数式を埋め込める数式コミュニティ