Class: Module

Inherits:
Object
  • Object
show all
Defined in:
lib/jiji/util/include_proxy.rb

Instance Method Summary collapse

Instance Method Details

#include_proxy(mod) ⇒ Object

プロキシモジュールをincludeする。



3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/jiji/util/include_proxy.rb', line 3

def include_proxy( mod )
  include mod
  class << self 
    def const_missing(id)
      self.included_modules.each {|m|
        begin
          return m.const_get(id)
        rescue NameError
        end
      }
      raise NameError.new
    end
  end
end