るりまサーチ (Ruby 2.3.0)

最速Rubyリファレンスマニュアル検索!
2件ヒット [1-2件を表示] (0.070秒)
トップページ > バージョン:2.3.0[x] > クラス:Module[x] > クエリ:remove_const[x]

別のキーワード

  1. fileutils remove_entry
  2. fileutils remove_dir
  3. fileutils remove_file
  4. fileutils remove
  5. rexml/document remove

ライブラリ

検索結果

Module#remove_const(name) -> object (54325.0)

name で指定した定数を取り除き、その定数に設定されていた値を 返します。

...指定した(まだロードしてない)定数を含めて削除する事ができます。

取り除かれた定数は参照できなくなりますが、消える訳ではないので注意して
使用してください。

@see Module#remove_class_variable, Object#remove_instance_variable...

Module#remove_class_variable(name) -> object (22.0)

引数で指定したクラス変数を取り除き、そのクラス変数に設定さ れていた値を返します。

...ールやクラスに定義されていない場合に発生します。

//emlist[例][ruby]{
class Foo
@@foo = 1
remove_class_variable(:@@foo) # => 1
p @@foo # => uninitialized class variable @@foo in Foo (NameError)
end
//}

@see Module#remove_const, Object#remove_instance_variable...