るりまサーチ

最速Rubyリファレンスマニュアル検索!
330件ヒット [201-300件を表示] (0.126秒)

ライブラリ

キーワード

検索結果

<< < 1 2 3 4 > >>

CSV::Row#include?(name) -> bool (2.0)

自身のヘッダに与えられた値が含まれている場合は真を返します。 そうでない場合は偽を返します。

...い場合は偽を返します。

@param name この行のヘッダに含まれているかどうか調べたい値を指定します。

//emlist[例][ruby]{
require "csv"

row = CSV::Row.new(["header1", "header2"], [1, 2])
row.header?("header1") # => true
row.header?("header3") # => false
//}...

CSV::Row#index(header, minimum_index = 0) -> Integer (2.0)

与えられたヘッダの名前に対応するインデックスを返します。

...の名前を探します。
重複しているヘッダがある場合に便利です。

//emlist[例][ruby]{
require "csv"

row = CSV::Row.new(["header1", "header2", "header1"], [1, 2, 3])
row.index("header1") # => 0
row.index("header1", 1) # => 2
//}

@see CSV::Row#field...

CSV::Row#inspect -> String (2.0)

ASCII 互換であるエンコーディングの文字列で自身の情報を返します。

...ASCII 互換であるエンコーディングの文字列で自身の情報を返します。

//emlist[例][ruby]{
require "csv"

row = CSV::Row.new(["header1", "header2", "header1"], [1, 2, 3])
row.inspect # => "#<CSV::Row \"header1\":1 \"header2\":2 \"header1\":3>"
//}...

CSV::Row#length -> Integer (2.0)

Array#length, Array#size に委譲します。

Array#length, Array#size に委譲します。


@see Array#size

CSV::Row#push(*args) -> self (2.0)

複数のフィールドを追加するためのショートカットです。

複数のフィールドを追加するためのショートカットです。

以下とおなじです:
args.each { |arg| csv_row << arg }

@return メソッドチェーンのために自身を返します。

絞り込み条件を変える

CSV::Row#row -> Array (2.0)

同値性を比較するために使用する内部的なデータです。

同値性を比較するために使用する内部的なデータです。

CSV::Row#size -> Integer (2.0)

Array#length, Array#size に委譲します。

Array#length, Array#size に委譲します。


@see Array#size

CSV::Row#to_csv -> String (2.0)

自身を CSV な文字列として返します。ヘッダは使用しません。

...自身を CSV な文字列として返します。ヘッダは使用しません。

//emlist[例][ruby]{
require "csv"

row = CSV::Row.new(["header1", "header2"], [1, 2])
row.to_csv # => "1,2\n"
row.to_csv( {col_sep: "|", row_sep: "<br>"} ) # => "1|2<br>"
//}...

CSV::Row#to_hash -> Hash (2.0)

自身をシンプルなハッシュに変換します。

...プルなハッシュに変換します。

フィールドの順序は無視されます。
重複したフィールドは削除されます。

//emlist[例][ruby]{
require "csv"

row = CSV::Row.new(["header2", "header1", "header2"], [1, 2, 3])
row.to_hash # => {"header2"=>3, "header1"=>2}
//}...
<< < 1 2 3 4 > >>