instance method Module#const_missing
const_missing(name)
-
定義されていない定数を参照したときに Ruby インタプリタが このメソッドを呼びます。
- [PARAM] name:
- 参照した定数名の Symbol
- [EXCEPTION] NameError:
- このメソッドを呼び出した場合、デフォルトで発生する例外
class Foo def Foo.const_missing(id) warn "undefined constant #{id.inspect}" end Bar end Foo::Bar # => undefined constant :Bar undefined constant :Bar
class Module