ライブラリ
- ビルトイン (245)
- csv (88)
- mkmf (22)
-
rdoc
/ markup (33)
クラス
- Array (11)
- CSV (55)
-
CSV
:: FieldInfo (33) -
Encoding
:: Converter (110) -
Encoding
:: InvalidByteSequenceError (22) - Hash (11)
- IO (11)
- Integer (3)
-
RDoc
:: Markup (33) - Rational (11)
- Regexp (22)
- String (11)
モジュール
- Kernel (55)
キーワード
- =~ (11)
- Float (11)
- Integer (11)
-
add
_ html (11) -
add
_ special (11) -
asciicompat
_ encoding (22) -
convert
_ type (11) -
convertible
_ int (22) -
error
_ bytes (11) -
get
_ line _ types (11) - header (11)
-
header
_ convert (22) -
incomplete
_ input? (11) - index (11)
-
insert
_ output (11) -
last
_ error (11) - line (11)
-
primitive
_ convert (44) - putc (11)
-
rb
_ check _ convert _ type (11) -
rb
_ convert _ type (11) -
rdoc
/ markup / to _ html (11) - replacement (11)
- replacement= (11)
-
ruby 1
. 8 . 2 feature (11) -
try
_ convert (58) -
unconverted
_ fields? (11)
検索結果
先頭5件
-
Rational
# convert(*arg) -> Rational (21201.0) -
引数を有理数(Rational)に変換した結果を返します。
...引数を有理数(Rational)に変換した結果を返します。
@param arg 変換対象のオブジェクトです。
Kernel.#Rational の本体です。
@see Kernel.#Rational... -
CSV
# convert {|field , field _ info| . . . } (18321.0) -
引数 name で指定した変換器かブロックに各フィールドを渡して文字列から別 のオブジェクトへと変換します。
...ールドを渡して文字列から別
のオブジェクトへと変換します。
引数 name を指定した場合は、組み込みの CSV::Converters を変換器
として利用するために使います。また、独自の変換器を追加することもできま
す。
ブロックパ......、フィールドと CSV::FieldInfo のインス
タンスを受け取ります。ブロックは変換後の値かフィールドそのものを返さな
ければなりません。
@param name 変換器の名前を指定します。
//emlist[例 name で Converter を指定][ruby]{
require "csv.......convert(:date)
csv.read # => 2018-07-09 ((2458309j,0s,0n),+0s,2299161j)>, #<Date: 2018-07-10 ((2458310j,0s,0n),+0s,2299161j)>
//}
//emlist[例 ブロックを指定][ruby]{
require "csv"
csv = CSV.new("date1,date2\n2018-07-09,2018-07-10", headers: true)
csv.convert do |field,field_info|
p fiel... -
CSV
# convert {|field| . . . } (18221.0) -
引数 name で指定した変換器かブロックに各フィールドを渡して文字列から別 のオブジェクトへと変換します。
...ールドを渡して文字列から別
のオブジェクトへと変換します。
引数 name を指定した場合は、組み込みの CSV::Converters を変換器
として利用するために使います。また、独自の変換器を追加することもできま
す。
ブロックパ......、フィールドと CSV::FieldInfo のインス
タンスを受け取ります。ブロックは変換後の値かフィールドそのものを返さな
ければなりません。
@param name 変換器の名前を指定します。
//emlist[例 name で Converter を指定][ruby]{
require "csv.......convert(:date)
csv.read # => 2018-07-09 ((2458309j,0s,0n),+0s,2299161j)>, #<Date: 2018-07-10 ((2458310j,0s,0n),+0s,2299161j)>
//}
//emlist[例 ブロックを指定][ruby]{
require "csv"
csv = CSV.new("date1,date2\n2018-07-09,2018-07-10", headers: true)
csv.convert do |field,field_info|
p fiel... -
Kernel
# convertible _ int(type , headers = nil , opts = nil) (12216.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......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' w......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
#defin... -
Kernel
# convertible _ int(type , headers = nil , opts = nil) { . . . } (12216.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......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' w......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
#defin... -
CSV
# unconverted _ fields? -> bool (12206.0) -
パースした結果が unconverted_fields というメソッドを持つ場合に真を返します。 そうでない場合は、偽を返します。
...ースした結果が unconverted_fields というメソッドを持つ場合に真を返します。
そうでない場合は、偽を返します。
//emlist[例][ruby]{
require "csv"
csv = CSV.new("date1,date2\n2018-07-09,2018-07-10")
csv.unconverted_fields? # => nil
csv = CSV.new("date1,date2......\n2018-07-09,2018-07-10", unconverted_fields: false)
csv.unconverted_fields? # => false
csv = CSV.new("date1,date2\n2018-07-09,2018-07-10", headers: true, unconverted_fields: true)
csv.unconverted_fields? # => true
csv.convert(:date)
row = csv.readline
row.fields # => [#<Date: 2018-07-0......9 ((2458309j,0s,0n),+0s,2299161j)>, #<Date: 2018-07-10 ((2458310j,0s,0n),+0s,2299161j)>]
row.unconverted_fields # => ["2018-07-09", "2018-07-10"]
//}
@see CSV.new... -
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer) -> Symbol (9216.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...搬性を確保しつつ、不正なバイトや変換先で未定義な文字の扱いを細かに指定したいときは、Encoding::Converter#primitive_convert が唯一の方法になります。
@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字......Symbol
options には以下が指定できます。
: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion after output before input
: integer form
Encoding::Converter::PARTIAL_INPUT
Encoding::Converter::......値は以下のうちのどれかです。
* :invalid_byte_sequence
* :incomplete_input
* :undefined_conversion
* :after_output
* :destination_buffer_full
* :source_buffer_empty
* :finished
//emlist[][ruby]{
ec = Encoding::Converter.new("UTF-8", "EUC-JP")
src = "abc\x81あいう\u{20... -
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset) -> Symbol (9216.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...搬性を確保しつつ、不正なバイトや変換先で未定義な文字の扱いを細かに指定したいときは、Encoding::Converter#primitive_convert が唯一の方法になります。
@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字......Symbol
options には以下が指定できます。
: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion after output before input
: integer form
Encoding::Converter::PARTIAL_INPUT
Encoding::Converter::......値は以下のうちのどれかです。
* :invalid_byte_sequence
* :incomplete_input
* :undefined_conversion
* :after_output
* :destination_buffer_full
* :source_buffer_empty
* :finished
//emlist[][ruby]{
ec = Encoding::Converter.new("UTF-8", "EUC-JP")
src = "abc\x81あいう\u{20... -
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset , destination _ bytesize) -> Symbol (9216.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...搬性を確保しつつ、不正なバイトや変換先で未定義な文字の扱いを細かに指定したいときは、Encoding::Converter#primitive_convert が唯一の方法になります。
@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字......Symbol
options には以下が指定できます。
: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion after output before input
: integer form
Encoding::Converter::PARTIAL_INPUT
Encoding::Converter::......値は以下のうちのどれかです。
* :invalid_byte_sequence
* :incomplete_input
* :undefined_conversion
* :after_output
* :destination_buffer_full
* :source_buffer_empty
* :finished
//emlist[][ruby]{
ec = Encoding::Converter.new("UTF-8", "EUC-JP")
src = "abc\x81あいう\u{20... -
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset , destination _ bytesize , options) -> Symbol (9216.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...搬性を確保しつつ、不正なバイトや変換先で未定義な文字の扱いを細かに指定したいときは、Encoding::Converter#primitive_convert が唯一の方法になります。
@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字......Symbol
options には以下が指定できます。
: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion after output before input
: integer form
Encoding::Converter::PARTIAL_INPUT
Encoding::Converter::......値は以下のうちのどれかです。
* :invalid_byte_sequence
* :incomplete_input
* :undefined_conversion
* :after_output
* :destination_buffer_full
* :source_buffer_empty
* :finished
//emlist[][ruby]{
ec = Encoding::Converter.new("UTF-8", "EUC-JP")
src = "abc\x81あいう\u{20...