12件ヒット
[1-12件を表示]
(0.099秒)
別のキーワード
ライブラリ
- ビルトイン (12)
検索結果
-
Hash
# [](key) -> object | nil (18126.0) -
key に関連づけられた値を返します。
... Hash#fetch または Hash#key? を使ってください。
@param key 探索するキーを指定します。
//emlist[例][ruby]{
h = {:ab => "some" , :cd => "all"}
p h[:ab] #=> "some"
p h[:ef] #=> nil
h1 = Hash.new("default value")
p h1[:non] #=> "default va......lue"
h2 = Hash.new {|*arg| arg}
p h2[:non] #=> [{}, :non]
//}
@see Hash.new, Hash#fetch,Hash#values_at,Hash#key?, Hash#default, Hash#default_proc...