るりまサーチ

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

別のキーワード

  1. _builtin first
  2. array first
  3. matrix first_minor
  4. range first
  5. enumerable first

ライブラリ

クラス

検索結果

CSV::Row#values_at(*headers_and_or_indices) -> Array (15216.0)

与えられた引数に対応する値の配列を返します。

...るこ
とができます。

@return 引数を与えなかった場合は全ての要素を返します。

require 'csv'
csv = CSV.new("a,b,c\n1,2,3", headers: true)
table = csv.read
row = table.first
row.values_at("a", 1, 2..3) # => ["1", "2", "3", nil]...

CSV::Row#fields(*headers_and_or_indices) -> Array (116.0)

与えられた引数に対応する値の配列を返します。

...るこ
とができます。

@return 引数を与えなかった場合は全ての要素を返します。

require 'csv'
csv = CSV.new("a,b,c\n1,2,3", headers: true)
table = csv.read
row = table.first
row.values_at("a", 1, 2..3) # => ["1", "2", "3", nil]...