108件ヒット
[101-108件を表示]
(0.060秒)
別のキーワード
ライブラリ
- ビルトイン (108)
キーワード
-
_ dump (12) - clone (12)
- dup (12)
-
initialize
_ copy (12) - inspect (12)
-
instance
_ variable _ defined? (12) -
instance
_ variable _ get (12) -
marshal
_ dump (12)
検索結果
-
Object
# instance _ variable _ get(var) -> object | nil (32.0) -
オブジェクトのインスタンス変数の値を取得して返します。
...を返します。
@param var インスタンス変数名を文字列か Symbol で指定します。
//emlist[][ruby]{
class Foo
def initialize
@foo = 1
end
end
obj = Foo.new
p obj.instance_variable_get("@foo") #=> 1
p obj.instance_variable_get(:@foo) #=> 1
p obj.instance_variab......le_get(:@bar) #=> nil
//}
@see Object#instance_variable_set,Object#instance_variables,Object#instance_variable_defined?...