るりまサーチ

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

別のキーワード

  1. argf.class each_line
  2. argf.class each
  3. argf.class lines
  4. argf.class set_encoding
  5. argf.class to_a

ライブラリ

検索結果

Module#const_missing(name) (39115.0)

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

...の Symbol

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


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

Bar
end
Foo::Bar

# => undefined constant :Bar
# undefined constant :Bar...