るりまサーチ

最速Rubyリファレンスマニュアル検索!
12件ヒット [1-12件を表示] (0.125秒)
トップページ > クエリ:t[x] > クエリ:@[x] > 種類:インスタンスメソッド[x] > クラス:Module[x] > クエリ:inspect[x] > クエリ:const_missing[x]

別のキーワード

  1. _builtin inspect
  2. csv inspect
  3. inspect _builtin
  4. matrix inspect
  5. rake inspect

ライブラリ

検索結果

Module#const_missing(name) (24227.0)

定義されていない定数を参照したときに Ruby インタプリタが このメソッドを呼びます。

...

@
param name 参照した定数名の Symbol

@
raise NameError このメソッドを呼び出した場合、デフォルトで発生する例外


//emlist[例][ruby]{
class Foo
def Foo.const_missing(id)
warn "undefined constant #{id.inspect}"
end

Bar
end
Foo::Bar

# => undefined constan...
...t :Bar
# undefined constant :Bar
//}...