るりまサーチ

最速Rubyリファレンスマニュアル検索!
104件ヒット [101-104件を表示] (0.074秒)

別のキーワード

  1. uri default_port
  2. _builtin default
  3. socket ai_default
  4. generic default_port
  5. socket ip_default_multicast_ttl

ライブラリ

クラス

モジュール

検索結果

<< < 1 2 >>

Hash#[](key) -> object | nil (37.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 val...
...ue"

h2 = Hash.new {|*arg| arg}
p h2[:non] #=> [{}, :non]
//}

@see Hash.new, Hash#fetch,Hash#values_at,Hash#key?, Hash#default, Hash#default_proc...
<< < 1 2 >>