るりまサーチ (Ruby 2.3.0)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.028秒)
トップページ > クラス:Hash[x] > バージョン:2.3.0[x] > クエリ:Hash[x] > クエリ:rassoc[x]

別のキーワード

  1. _builtin hash
  2. hash []
  3. matrix hash
  4. dbm to_hash
  5. _builtin to_hash

ライブラリ

検索結果

Hash#rassoc(value) -> Array | nil (117379.0)

ハッシュ内を検索して,引数 value と 一致する値を探します。

...とするサイズ 2 の配列を返します。
ない場合には nil を返します。

@param value 探索する値。

//emlist[例][ruby]{
a = {1=> "one", 2 => "two", 3 => "three", "ii" => "two"}
a.rassoc("two") #=> [2, "two"]
a.rassoc("four") #=> nil
//}

@see Hash#assoc, Array#rassoc...