2件ヒット
[1-2件を表示]
(0.106秒)
検索結果
-
CSV
:: Row # deconstruct -> [object] (87343.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 are 2 or more"
end
#=> "first column is less than ... -
CSV
:: Row # deconstruct _ keys(keys) -> Hash (51343.0) -
パターンマッチに使用するヘッダの名前と値の Hash を返します。
パターンマッチに使用するヘッダの名前と値の Hash を返します。
このメソッドはヘッダ名の型をシンボルに変換しないため、ヘッダ名が文字列かつ Hash パターン でパターンマッチしたい場合はキーをシンボルに変換する必要があります。
@param keys パターンマッチに使用するヘッダの名前の配列を指定します。nil の場合は全てをパターンマッチに使用します。
//emlist[例][ruby]{
require "csv"
row = CSV::Row.new([:header1, :header2, :header3], [1, 2, 3])
case row
in { hea...