るりまサーチ

最速Rubyリファレンスマニュアル検索!
22件ヒット [1-22件を表示] (0.055秒)
トップページ > クエリ:-[x] > クエリ:to_a[x] > クラス:CSV::Row[x]

別のキーワード

  1. _builtin to_s
  2. openssl to_der
  3. openssl to_s
  4. _builtin to_a
  5. openssl to_pem

ライブラリ

キーワード

検索結果

CSV::Row#<<(arg) -> self (113.0)

自身に与えられたデータを追加します。

...列を指定][ruby]{
require "csv"

row = CSV::Row.new([], [], true)

row << ["header1", "row1_1"]
row << ["header2", "row1_2"]
row.to_a # => [["header1", "row1_1"], ["header2", "row1_2"]]
//}

//emlist[例 Hash を指定][ruby]{
require "csv"

row = CSV::Row.new([], [], true)

row << { "header1" =>...
..."row1_1" }
row << { "header2" => "row1_2" }
row.to_a # => [["header1", "row1_1"], ["header2", "row1_2"]]
//}...

CSV::Row.new(headers, fields, header_row = false) -> CSV::Row (113.0)

自身を初期化します。

...ader = CSV::Row.new(["header1", "header2"], [], header_row: true)
table = CSV::Table.new([header])
table.to_a # => [["header1", "header2"]]
//}

//emlist[例 header_row = false のケース][ruby]{
require "csv"

row1 = CSV::Row.new(["header1", "header2"], ["row1_1", "row1_2"])
row2 = CSV::Row.new([...
..."header1", "header2"], ["row2_1", "row2_2"])
table = CSV::Table.new([row1, row2])
table.to_a # => [["header1", "header2"], ["row1_1", "row1_2"], ["row2_1", "row2_2"]]
//}

@see CSV::Row#header_row?, CSV::Row#field_row?...