るりまサーチ (Ruby 2.6.0)

最速Rubyリファレンスマニュアル検索!
15件ヒット [1-15件を表示] (0.016秒)
トップページ > クエリ:convert[x] > バージョン:2.6.0[x] > クエリ:header[x]

別のキーワード

  1. csv convert
  2. csv header_convert
  3. _builtin try_convert
  4. converter primitive_convert
  5. _builtin primitive_convert

ライブラリ

クラス

モジュール

検索結果

CSV#convert {|field, field_info| ... } (54418.0)

引数 name で指定した変換器かブロックに各フィールドを渡して文字列から別 のオブジェクトへと変換します。

引数 name で指定した変換器かブロックに各フィールドを渡して文字列から別
のオブジェクトへと変換します。

引数 name を指定した場合は、組み込みの CSV::Converters を変換器
として利用するために使います。また、独自の変換器を追加することもできま
す。

ブロックパラメータを一つ受け取るブロックを与えた場合は、そのブロックは
フィールドを受け取ります。ブロックパラメータを二つ受け取るブロックを与
えた場合は、そのブロックは、フィールドと CSV::FieldInfo のインス
タンスを受け取ります。ブロックは変換後の値かフィールドそのものを返さな
ければなりません。
...

CSV#convert {|field| ... } (54418.0)

引数 name で指定した変換器かブロックに各フィールドを渡して文字列から別 のオブジェクトへと変換します。

引数 name で指定した変換器かブロックに各フィールドを渡して文字列から別
のオブジェクトへと変換します。

引数 name を指定した場合は、組み込みの CSV::Converters を変換器
として利用するために使います。また、独自の変換器を追加することもできま
す。

ブロックパラメータを一つ受け取るブロックを与えた場合は、そのブロックは
フィールドを受け取ります。ブロックパラメータを二つ受け取るブロックを与
えた場合は、そのブロックは、フィールドと CSV::FieldInfo のインス
タンスを受け取ります。ブロックは変換後の値かフィールドそのものを返さな
ければなりません。
...

CSV#convert(name) (54418.0)

引数 name で指定した変換器かブロックに各フィールドを渡して文字列から別 のオブジェクトへと変換します。

引数 name で指定した変換器かブロックに各フィールドを渡して文字列から別
のオブジェクトへと変換します。

引数 name を指定した場合は、組み込みの CSV::Converters を変換器
として利用するために使います。また、独自の変換器を追加することもできま
す。

ブロックパラメータを一つ受け取るブロックを与えた場合は、そのブロックは
フィールドを受け取ります。ブロックパラメータを二つ受け取るブロックを与
えた場合は、そのブロックは、フィールドと CSV::FieldInfo のインス
タンスを受け取ります。ブロックは変換後の値かフィールドそのものを返さな
ければなりません。
...

CSV::FieldInfo#header -> String | nil (54340.0)

利用可能な場合はヘッダを表す文字列を返します。

利用可能な場合はヘッダを表す文字列を返します。

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

csv = CSV.new("date1,date2\n2018-07-09,2018-07-10", headers: true)
csv.convert do |field,field_info|
p field_info.header
Date.parse(field)
end
p csv.first

# => "date1"
# => "date2"
# => #<CSV::Row "date1":#<Date: 2018-07-09 ((2458309j,...

CSV#header_convert {|field, field_info| ... } (36919.0)

CSV#convert に似ていますが、ヘッダ行用のメソッドです。

CSV#convert に似ていますが、ヘッダ行用のメソッドです。

このメソッドはヘッダ行を読み込む前に呼び出さなければなりません。

@param name 変換器の名前を指定します。

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

csv = CSV.new("header1,header2\nrow1_1,row1_2", headers: true)
csv.header_convert(:symbol)
csv.first.headers # => [:header1, :header2]
//}

//emlist[例 ブロックを指定][...

絞り込み条件を変える

CSV#header_convert {|field| ... } (36919.0)

CSV#convert に似ていますが、ヘッダ行用のメソッドです。

CSV#convert に似ていますが、ヘッダ行用のメソッドです。

このメソッドはヘッダ行を読み込む前に呼び出さなければなりません。

@param name 変換器の名前を指定します。

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

csv = CSV.new("header1,header2\nrow1_1,row1_2", headers: true)
csv.header_convert(:symbol)
csv.first.headers # => [:header1, :header2]
//}

//emlist[例 ブロックを指定][...

CSV#header_convert(name) (36919.0)

CSV#convert に似ていますが、ヘッダ行用のメソッドです。

CSV#convert に似ていますが、ヘッダ行用のメソッドです。

このメソッドはヘッダ行を読み込む前に呼び出さなければなりません。

@param name 変換器の名前を指定します。

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

csv = CSV.new("header1,header2\nrow1_1,row1_2", headers: true)
csv.header_convert(:symbol)
csv.first.headers # => [:header1, :header2]
//}

//emlist[例 ブロックを指定][...

CSV#header_converters -> Array (36712.0)

現在有効なヘッダ用変換器のリストを返します。

現在有効なヘッダ用変換器のリストを返します。

組込みの変換器は名前を返します。それ以外は、オブジェクトを返します。

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

csv = CSV.new("HEADER1,HEADER2\nrow1_1,row1_2", headers: true, header_converters: CSV::HeaderConverters.keys)
csv.header_converters # => [:downcase, :symbol]
csv.read.to_a # => header2], ["row1_1",...

CSV::HeaderConverters -> Hash (36637.0)

このハッシュは名前でアクセスできる組み込みのヘッダ用変換器を保存しています。

このハッシュは名前でアクセスできる組み込みのヘッダ用変換器を保存しています。

CSV#header_convert で使用する変換器として使用できます。
また CSV.new のオプションとして使用することもできます。

: :downcase
ヘッダの文字列に対して String#downcase を呼び出します。
: :symbol
ヘッダの文字列を小文字に変換してから、空白文字列 (\s) をアンダースコアに
置換し、非英数字 (\W) を削除します。最後に String#to_sym を呼び出します。

全ての組み込みのヘッダ用変換器は、実際に変換する前にヘッダのデータ...

Kernel#convertible_int(type, headers = nil, opts = nil) (18649.0)

Returns the convertible integer type of the given +type+. You may optionally specify additional +headers+ to search in for the +type+. _Convertible_ means actually same type, or typedefed from same type. If the +type+ is a integer type and _convertible_ type is found, following macros are passed as preprocessor constants to the compiler using the +type+ name, in uppercase. * 'TYPEOF_', followed by the +type+ name, followed by '=X' where 'X' is the found _convertible_ type name. * 'TYP2NUM' and 'NUM2TYP, where 'TYP' is the +type+ name in uppercase with replacing '_t' suffix with 'T', followed by '=X' where 'X' is the macro name to convert +type+ to +Integer+ object, and vice versa. For example, if foobar_t is defined as unsigned long, then convertible_int("foobar_t") would return "unsigned long", and define macros: #define TYPEOF_FOOBAR_T unsigned long #define FOOBART2NUM ULONG2NUM #define NUM2FOOBART NUM2ULONG

Returns the convertible integer type of the given +type+. You may
optionally specify additional +headers+ to search in for the +type+.
_Convertible_ means actually same type, or typedefed from same type.

If the +type+ is a integer type and _convertible_ type is found,
following macros are p...

絞り込み条件を変える

Kernel#convertible_int(type, headers = nil, opts = nil) { ... } (18649.0)

Returns the convertible integer type of the given +type+. You may optionally specify additional +headers+ to search in for the +type+. _Convertible_ means actually same type, or typedefed from same type. If the +type+ is a integer type and _convertible_ type is found, following macros are passed as preprocessor constants to the compiler using the +type+ name, in uppercase. * 'TYPEOF_', followed by the +type+ name, followed by '=X' where 'X' is the found _convertible_ type name. * 'TYP2NUM' and 'NUM2TYP, where 'TYP' is the +type+ name in uppercase with replacing '_t' suffix with 'T', followed by '=X' where 'X' is the macro name to convert +type+ to +Integer+ object, and vice versa. For example, if foobar_t is defined as unsigned long, then convertible_int("foobar_t") would return "unsigned long", and define macros: #define TYPEOF_FOOBAR_T unsigned long #define FOOBART2NUM ULONG2NUM #define NUM2FOOBART NUM2ULONG

Returns the convertible integer type of the given +type+. You may
optionally specify additional +headers+ to search in for the +type+.
_Convertible_ means actually same type, or typedefed from same type.

If the +type+ is a integer type and _convertible_ type is found,
following macros are p...

CSV#converters -> Array (18337.0)

現在の変換器のリストを返します。

現在の変換器のリストを返します。

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

csv = CSV.new("header1,header2\nrow1_1,row1_2", converters: CSV::Converters.keys)
csv.converters # => [:integer, :float, :integer, :float, :date, :date_time, :date_time, :integer, :float]
//}

@see CSV::Converters

ruby 1.9 feature (91.0)

ruby 1.9 feature ruby version 1.9.0 は開発版です。 以下にあげる機能は将来削除されたり互換性のない仕様変更がなされるかもしれません。 1.9.1 以降は安定版です。 バグ修正がメインになります。

ruby 1.9 feature
ruby version 1.9.0 は開発版です。
以下にあげる機能は将来削除されたり互換性のない仕様変更がなされるかもしれません。
1.9.1 以降は安定版です。
バグ修正がメインになります。

記号について(特に重要なものは大文字(主観))

* カテゴリ
* [ruby]: ruby インタプリタの変更
* [api]: 拡張ライブラリ API
* [lib]: ライブラリ
* [parser]: 文法の変更
* [regexp]: 正規表現の機能拡張
* [marshal]: Marshal ファイルのフォーマット変更
* ...

ruby 1.8.3 feature (73.0)

ruby 1.8.3 feature *((<ruby 1.8 feature>)) *((<ruby 1.8.2 feature>))

ruby 1.8.3 feature
*((<ruby 1.8 feature>))
*((<ruby 1.8.2 feature>))

ruby 1.8.2 から ruby 1.8.3 までの変更点です。

掲載方針

*バグ修正の影響も含めて動作が変わるものを収録する。
*単にバグを直しただけのものは収録しない。
*ライブラリへの単なる定数の追加は収録しない。

以下は各変更点に付けるべきタグです。

記号について(特に重要なものは大文字(主観))

* カテゴリ
* [ruby]: ruby インタプリタの変更
* [api]: 拡張ライブラリ API
* [lib]: ...

ruby 1.6 feature (55.0)

ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。

ruby 1.6 feature
ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン
になります。

((<stable-snapshot|URL:ftp://ftp.netlab.co.jp/pub/lang/ruby/stable-snapshot.tar.gz>)) は、日々更新される安定版の最新ソースです。

== 1.6.8 (2002-12-24) -> stable-snapshot

: 2003-01-22: errno

EAGAIN と EWOULDBLOCK が同じ値のシステムで、EWOULDBLOCK がなくなっ
ていま...

絞り込み条件を変える