るりまサーチ

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

別のキーワード

  1. csv instance
  2. _builtin instance_eval
  3. basicobject instance_eval
  4. forwardable instance_delegate
  5. forwardable def_instance_delegator

ライブラリ

検索結果

Object#remove_instance_variable(name) -> object (30334.0)

オブジェクトからインスタンス変数 name を取り除き、そのインス タンス変数に設定されていた値を返します。

...ない場合に発生します。

//emlist[][ruby]{
class Foo
def foo
@foo = 1
p remove_instance_variable(:@foo) #=> 1
p remove_instance_variable(:@foo) # instance variable @foo not defined (NameError)
end
end
Foo.new.foo
//}

@see Module#remove_class_variable,Module#remove_const...