18件ヒット
[1-18件を表示]
(0.019秒)
別のキーワード
キーワード
- deconstruct (3)
-
deconstruct
_ keys (3) - each (12)
検索結果
先頭3件
-
CSV
:: Row # deconstruct -> [object] (22.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
#=>... -
CSV
:: Row # deconstruct _ keys(keys) -> Hash (22.0) -
パターンマッチに使用するヘッダの名前と値の Hash を返します。
...チに使用します。
//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 { header1: ...2, header2: 2.., header3: 2.. }
puts "first column is less than 2, and rest c... -
CSV
:: Row # each {|header , field| . . . } -> self (16.0) -
与えられたブロックにヘッダとフィールドの組を渡して評価します。
...@return メソッドチェーンのために自身を返します。
//emlist[例][ruby]{
require "csv"
row = CSV::Row.new(["header1", "header2", "header3", "header4"], [1, 2, 3, 4])
row.each { |header, field| puts "#{header} - #{field}" }
# => header1 - 1
# => header2 - 2
# => header3 - 3
# => h...