108件ヒット
[101-108件を表示]
(0.071秒)
別のキーワード
ライブラリ
- ビルトイン (108)
キーワード
-
_ dump (12) -
initialize
_ copy (12) - inspect (12)
-
instance
_ variable _ defined? (12) -
instance
_ variable _ get (12) -
marshal
_ dump (12) -
singleton
_ method (12) -
to
_ s (12)
検索結果
-
Object
# instance _ variable _ get(var) -> object | nil (38.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_variable_get(:@bar)......#=> nil
//}
@see Object#instance_variable_set,Object#instance_variables,Object#instance_variable_defined?...