検索結果
-
CSV
:: Row # deconstruct -> [object] (29113.0) -
パターンマッチに使用する行の値の配列を返します。
...パターンマッチに使用する行の値の配列を返します。
//emlist[例][ruby]{
require "csv"
row = CSV::Row.new(["header1", "header2", "header3"], [1, 2, 3])
case row
in [2.., 2.., 2..]
puts "all 2 or more"
in [...2, 2.., 2..]
puts "first column is less than 2, and rest columns... -
CSV
:: Row # deconstruct _ keys(keys) -> Hash (17113.0) -
パターンマッチに使用するヘッダの名前と値の Hash を返します。
...ダの名前の配列を指定します。nil の場合は全てをパターンマッチに使用します。
//emlist[例][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 { header...