るりまサーチ

最速Rubyリファレンスマニュアル検索!
9件ヒット [1-9件を表示] (0.053秒)

別のキーワード

  1. module deprecate_constant
  2. _builtin deprecate_constant
  3. deprecate_constant symbol
  4. deprecate_constant string
  5. deprecate_constant module

クラス

検索結果

Module#deprecate_constant(*name) -> self (18116.0)

name で指定した定数を deprecate に設定します。 deprecate に設定した定数を参照すると警告メッセージが表示されます。

...定数を指定した場合に発生します。

@return self を返します。

//emlist[例][ruby]{
FOO = 123
Object.deprecate_constant(:FOO) # => Object

FOO
# warning: constant ::FOO is deprecated
# => 123

Object.deprecate_constant(:BAR)
# NameError: constant Object::BAR not defined
//}...