るりまサーチ

最速Rubyリファレンスマニュアル検索!
3件ヒット [1-3件を表示] (0.042秒)
トップページ > クエリ:end[x] > クエリ:struct[x] > ライブラリ:csv[x] > クエリ:deconstruct_keys[x]

別のキーワード

  1. struct new
  2. mkmf have_struct_member
  3. struct each_pair
  4. struct select
  5. struct members

クラス

検索結果

CSV::Row#deconstruct_keys(keys) -> Hash (24209.0)

パターンマッチに使用するヘッダの名前と値の Hash を返します。

...ruby]{
require "csv"

row = CSV::Row.new([:header1, :header2, :header3], [1, 2, 3])
case row
in { header1: 2.., header2: 2.., header3: 2.. }
puts "all 2 or more"
in { header1: ...2, header2: 2.., header3: 2.. }
puts "first column is less than 2, and rest columns are 2 or more"
end

#=> "first col...