別のキーワード
ライブラリ
- ビルトイン (534)
- csv (180)
- mkmf (24)
-
rdoc
/ markup (84) -
rdoc
/ markup / formatter (24) -
webrick
/ httpversion (12)
クラス
- Array (24)
- CSV (144)
-
CSV
:: FieldInfo (36) -
Encoding
:: Converter (276) -
Encoding
:: InvalidByteSequenceError (24) -
Encoding
:: UndefinedConversionError (12) - Hash (12)
- IO (12)
- Integer (4)
-
RDoc
:: Markup (72) -
RDoc
:: Markup :: Formatter (12) - Range (14)
- Rational (12)
- Regexp (24)
- String (48)
-
WEBrick
:: HTTPVersion (12)
モジュール
- Kernel (60)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - =~ (12)
- Converter (12)
- ConverterEncoding (12)
- ConverterNotFoundError (12)
- Converters (12)
- Float (12)
- Formatter (12)
- HeaderConverters (12)
- Integer (12)
- Markup (12)
-
NEWS for Ruby 2
. 5 . 0 (8) -
NEWS for Ruby 3
. 1 . 0 (4) - UndefinedConversionError (12)
-
add
_ html (12) -
add
_ special (12) -
add
_ word _ pair (12) -
asciicompat
_ encoding (24) - content (12)
-
convert
_ type (12) - converters (12)
-
convertible
_ int (24) - convpath (12)
-
destination
_ encoding (12) - encode (36)
- entries (7)
-
error
_ bytes (12) -
error
_ char (12) - finish (12)
-
get
_ line _ types (12) - header (12)
-
header
_ convert (36) -
header
_ converters (12) -
incomplete
_ input? (12) - index (12)
-
insert
_ output (12) - inspect (12)
-
last
_ error (12) - line (12)
- new (36)
-
primitive
_ convert (48) -
primitive
_ errinfo (12) - putback (24)
- putc (12)
-
rb
_ check _ convert _ type (12) -
rb
_ convert _ type (12) - rdoc (12)
-
rdoc
/ markup / to _ ansi (12) -
rdoc
/ markup / to _ bs (12) -
rdoc
/ markup / to _ html (12) - replacement (12)
- replacement= (12)
- rss (12)
-
ruby 1
. 6 feature (12) -
ruby 1
. 8 . 2 feature (12) -
ruby 1
. 8 . 3 feature (12) -
ruby 1
. 9 feature (12) -
search
_ convpath (12) -
source
_ encoding (12) -
to
_ a (7) - transpose (12)
-
try
_ convert (64) -
unconverted
_ fields? (12) - 多言語化 (12)
検索結果
先頭5件
-
Array
. try _ convert(obj) -> Array | nil (6125.0) -
to_ary メソッドを用いて obj を配列に変換しようとします。
...引数が配列であるかどうかを調べるために使えます。
//emlist[例][ruby]{
Array.try_convert([1]) # => [1]
Array.try_convert("1") # => nil
if tmp = Array.try_convert(arg)
# the argument is an array
elsif tmp = String.try_convert(arg)
# the argument is a string
end
//}... -
Integer
. try _ convert(obj) -> Integer | nil (6119.0) -
obj を Integer に変換しようと試みます。変換には Object#to_int メソッドが使われます。
...param obj 変換する任意のオブジェクト
@return Integer または nil
@raise TypeError to_int が Integer を返さなかった場合に発生します。
//emlist[例][ruby]{
Integer.try_convert(1) # => 1
Integer.try_convert(1.25) # => 1
Integer.try_convert([]) # => nil
//}... -
Kernel
# convertible _ int(type , headers = nil , opts = nil) (6116.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......+ 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... -
Kernel
# convertible _ int(type , headers = nil , opts = nil) { . . . } (6116.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......+ 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... -
Hash
. try _ convert(obj) -> Hash | nil (6113.0) -
to_hash メソッドを用いて obj をハッシュに変換しようとします。
...しようとします。
何らかの理由で変換できないときには nil を返します。
このメソッドは引数がハッシュであるかどうかを調べるために使えます。
//emlist[][ruby]{
Hash.try_convert({1=>2}) # => {1=>2}
Hash.try_convert("1=>2") # => nil
//}... -
IO
. try _ convert(obj) -> IO | nil (6113.0) -
obj を to_io メソッドによって IO オブジェクトに変換します。 変換できなかった場合は nil を返します。
...obj を to_io メソッドによって IO オブジェクトに変換します。
変換できなかった場合は nil を返します。
IO.try_convert(STDOUT) # => STDOUT
IO.try_convert("STDOUT") # => nil... -
Regexp
. try _ convert(obj) -> Regexp | nil (6113.0) -
obj を to_regexp メソッドで Regexp オブジェクトに変換しようと 試みます。
...obj を to_regexp メソッドで Regexp オブジェクトに変換しようと
試みます。
変換に成功した場合はそれを返し、失敗時には nil を返します。
//emlist[例][ruby]{
Regexp.try_convert(/re/) # => /re/
Regexp.try_convert("re") # => nil
//}... -
String
. try _ convert(obj) -> String | nil (6113.0) -
obj を String に変換しようと試みます。変換には Object#to_str メソッ ドが使われます。変換後の文字列を返すか、何らかの理由により変換できなかっ た場合は nil が返されます。
...、何らかの理由により変換できなかっ
た場合は nil が返されます。
@param obj 変換する任意のオブジェクト
@return 変換後の文字列または nil
//emlist[例][ruby]{
String.try_convert("str") # => "str"
String.try_convert(/re/) # => nil
//}... -
CSV
# unconverted _ fields? -> bool (6106.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,d......ate2\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-09 ((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... -
CSV
:: Converters -> Hash (6106.0) -
このハッシュは名前でアクセスできる組み込みの変換器を保持しています。
...このハッシュは名前でアクセスできる組み込みの変換器を保持しています。
CSV#convert で使用する変換器として使用できます。
また CSV.new のオプションとして使用することもできます。
: :integer
Kernel.#Integer を使用してフ...