るりまサーチ (Ruby 2.4.0)

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

別のキーワード

  1. << rexml::attribute#name
  2. add rexml::attribute#name
  3. handle_interrupt thread#raise
  4. service drb::extserv#stop_service
  5. inspect? irb::context#inspect_mode

ライブラリ

検索結果

Hash#values_at(*keys) -> [object] (22.0)

引数で指定されたキーに対応する値の配列を返します。

...引数が指定されなかった場合は、空の配列を返します。

//emlist[例][ruby]{
h = {1=>"a", 2=>"b", 3=>"c"}

p h.values_at(1,3,4) #=> ["a", "c", nil]
# [h[1], h[3] ,h[4]] と同じ
//}

@see Hash#[] , Hash.new, Hash#default, Hash#default_proc, Array#values_at...