別のキーワード
種類
- インスタンスメソッド (17)
- 定数 (2)
- 特異メソッド (2)
クラス
- CSV (3)
-
CSV
:: FieldInfo (3) -
CSV
:: Table (5) - Socket (1)
-
URI
:: Generic (1) -
URI
:: MailTo (1)
モジュール
- Kernel (6)
-
Socket
:: Constants (1)
キーワード
-
IPV6
_ RTHDR (2) -
check
_ signedness (2) -
check
_ sizeof (2) -
col
_ sep (1) - component (1)
- encoding (1)
- generate (1)
- header (1)
- index (1)
- inspect (1)
- length (1)
- line (1)
- size (1)
-
to
_ csv (1) -
to
_ s (1) -
try
_ constant (2)
検索結果
先頭5件
- URI
:: MailTo # headers -> [[String]] - Kernel
# check _ signedness(type , headers = nil , opts = nil) -> "signed" | "unsigned" | nil - Kernel
# check _ signedness(type , headers = nil , opts = nil) { . . . } -> "signed" | "unsigned" | nil - CSV
# encoding -> Encoding - CSV
. generate(str = "" , options = Hash . new) {|csv| . . . } -> String
-
URI
:: MailTo # headers -> [[String]] (54622.0) -
自身のヘッダーを文字列の配列の配列として設定します。
自身のヘッダーを文字列の配列の配列として設定します。
例:
require 'uri'
m = URI.parse("mailto:ruby-list@ruby-lang.org?subject=subscribe&cc=myaddr")
p m.headers #=> [["subject", "subscribe"], ["cc", "myaddr"]] -
Kernel
# check _ signedness(type , headers = nil , opts = nil) -> "signed" | "unsigned" | nil (19255.0) -
Returns the signedness of the given +type+. You may optionally specify additional +headers+ to search in for the +type+. If the +type+ is found and is a numeric type, a macro is passed as a preprocessor constant to the compiler using the +type+ name, in uppercase, prepended with 'SIGNEDNESS_OF_', followed by the +type+ name, followed by '=X' where 'X' is positive integer if the +type+ is unsigned, or negative integer if the +type+ is signed. For example, if size_t is defined as unsigned, then check_signedness('size_t') would returned +1 and the SIGNEDNESS_OF_SIZE_T=+1 preprocessor macro would be passed to the compiler, and SIGNEDNESS_OF_INT=-1 if check_signedness('int') is done.
Returns the signedness of the given +type+. You may optionally
specify additional +headers+ to search in for the +type+.
If the +type+ is found and is a numeric type, a macro is passed as a
preprocessor constant to the compiler using the +type+ name, in
uppercase, prepended with 'SIGNEDNESS... -
Kernel
# check _ signedness(type , headers = nil , opts = nil) { . . . } -> "signed" | "unsigned" | nil (19255.0) -
Returns the signedness of the given +type+. You may optionally specify additional +headers+ to search in for the +type+. If the +type+ is found and is a numeric type, a macro is passed as a preprocessor constant to the compiler using the +type+ name, in uppercase, prepended with 'SIGNEDNESS_OF_', followed by the +type+ name, followed by '=X' where 'X' is positive integer if the +type+ is unsigned, or negative integer if the +type+ is signed. For example, if size_t is defined as unsigned, then check_signedness('size_t') would returned +1 and the SIGNEDNESS_OF_SIZE_T=+1 preprocessor macro would be passed to the compiler, and SIGNEDNESS_OF_INT=-1 if check_signedness('int') is done.
Returns the signedness of the given +type+. You may optionally
specify additional +headers+ to search in for the +type+.
If the +type+ is found and is a numeric type, a macro is passed as a
preprocessor constant to the compiler using the +type+ name, in
uppercase, prepended with 'SIGNEDNESS... -
CSV
# encoding -> Encoding (18619.0) -
読み書きするときに使用するエンコーディングを返します。
読み書きするときに使用するエンコーディングを返します。
//emlist[例][ruby]{
require "csv"
csv = CSV.new("header1,header2\nrow1_1,row1_2", headers: true)
csv.encoding # => #<Encoding:UTF-8>
//} -
CSV
. generate(str = "" , options = Hash . new) {|csv| . . . } -> String (18319.0) -
このメソッドは与えられた文字列をラップして CSV のオブジェクトとしてブロックに渡します。 ブロック内で CSV オブジェクトに行を追加することができます。 ブロックを評価した結果は文字列を返します。
このメソッドは与えられた文字列をラップして CSV のオブジェクトとしてブロックに渡します。
ブロック内で CSV オブジェクトに行を追加することができます。
ブロックを評価した結果は文字列を返します。
このメソッドに与えられた文字列は変更されるので、新しい文字列オブジェクトが必要な
場合は Object#dup で複製してください。
@param str 文字列を指定します。デフォルトは空文字列です。
@param options CSV.new のオプションと同じオプションを指定できます。
:encoding というキーを使用すると出力のエンコーディン... -
CSV
:: Table # length -> Integer (18319.0) -
(ヘッダを除く)行数を返します。
(ヘッダを除く)行数を返します。
Array#length, Array#size に委譲しています。
//emlist[][ruby]{
require 'csv'
csv = CSV.new("a,b,c\n1,2,3", headers: true)
table = csv.read
p table.size # => 1
//}
@see Array#length, Array#size -
CSV
:: Table # size -> Integer (9319.0) -
(ヘッダを除く)行数を返します。
(ヘッダを除く)行数を返します。
Array#length, Array#size に委譲しています。
//emlist[][ruby]{
require 'csv'
csv = CSV.new("a,b,c\n1,2,3", headers: true)
table = csv.read
p table.size # => 1
//}
@see Array#length, Array#size -
URI
:: Generic . component -> [Symbol] (9019.0) -
URI の構成要素を表すシンボルの配列を返します。
URI の構成要素を表すシンボルの配列を返します。
require 'uri'
p URI::Generic.component
p URI::MailTo.component
# => [:scheme, :userinfo, :host, :port, :registry, :path, :opaque, :query, :fragment]
# => [:scheme, :to, :headers] -
Kernel
# check _ sizeof(type , headers = nil) -> Integer | nil (625.0) -
与えられた型のサイズを返します。
与えられた型のサイズを返します。
型 type がシステムに存在する場合は、グローバル変数 $defs に
"-DSIZEOF_type=X" を追加し、型のサイズを返します。型 type がシステムに
存在しない場合は、nil を返します。
例えば、
require 'mkmf'
check_sizeof('mystruct') # => 12
である場合、SIZEOF_MYSTRUCT=12 というプリプロセッサマクロをコンパイラに渡します。
@param type 検査したい型を指定します。
@param headers 追加のヘッダファイルを指定します。 -
Kernel
# check _ sizeof(type , headers = nil) { . . . } -> Integer | nil (625.0) -
与えられた型のサイズを返します。
与えられた型のサイズを返します。
型 type がシステムに存在する場合は、グローバル変数 $defs に
"-DSIZEOF_type=X" を追加し、型のサイズを返します。型 type がシステムに
存在しない場合は、nil を返します。
例えば、
require 'mkmf'
check_sizeof('mystruct') # => 12
である場合、SIZEOF_MYSTRUCT=12 というプリプロセッサマクロをコンパイラに渡します。
@param type 検査したい型を指定します。
@param headers 追加のヘッダファイルを指定します。 -
Kernel
# try _ constant(const , headers = nil , opt = "") -> Integer | nil (625.0) -
定数 const がシステムに存在するかどうか検査します。 Kernel#have_const を使ってください。
定数 const がシステムに存在するかどうか検査します。
Kernel#have_const を使ってください。
@param const C 言語の定数名を指定します。
@param headers 追加のヘッダファイルを指定します。
@param opt コンパイラに渡すオプションを指定します。
$CFLAGS もコンパイラには渡されます。
@return 定数 const がシステムに存在する場合はその値を返します。
定数 const がシステムに存在しない場合は nil を返します。 -
Kernel
# try _ constant(const , headers = nil , opt = "") { . . . } -> Integer | nil (625.0) -
定数 const がシステムに存在するかどうか検査します。 Kernel#have_const を使ってください。
定数 const がシステムに存在するかどうか検査します。
Kernel#have_const を使ってください。
@param const C 言語の定数名を指定します。
@param headers 追加のヘッダファイルを指定します。
@param opt コンパイラに渡すオプションを指定します。
$CFLAGS もコンパイラには渡されます。
@return 定数 const がシステムに存在する場合はその値を返します。
定数 const がシステムに存在しない場合は nil を返します。 -
CSV
:: Table # to _ csv(options = Hash . new) -> String (355.0) -
CSV の文字列に変換して返します。
CSV の文字列に変換して返します。
ヘッダを一行目に出力します。その後に残りのデータを出力します。
デフォルトでは、ヘッダを出力します。オプションに :write_headers =>
false を指定するとヘッダを出力しません。
//emlist[][ruby]{
require 'csv'
csv = CSV.new("a,b,c\n1,2,3", headers: true)
table = csv.read
p table.to_csv # => "a,b,c\n1,2,3\n"
p table.to_csv(write_head... -
CSV
:: Table # to _ s(options = Hash . new) -> String (355.0) -
CSV の文字列に変換して返します。
CSV の文字列に変換して返します。
ヘッダを一行目に出力します。その後に残りのデータを出力します。
デフォルトでは、ヘッダを出力します。オプションに :write_headers =>
false を指定するとヘッダを出力しません。
//emlist[][ruby]{
require 'csv'
csv = CSV.new("a,b,c\n1,2,3", headers: true)
table = csv.read
p table.to_csv # => "a,b,c\n1,2,3\n"
p table.to_csv(write_head... -
Socket
:: Constants :: IPV6 _ RTHDR -> Integer (349.0) -
Allows removal of sticky routing headers。 BasicSocket#getsockopt, BasicSocket#setsockopt の第2引数(optname)に使用します。
Allows removal of sticky routing headers。
BasicSocket#getsockopt, BasicSocket#setsockopt
の第2引数(optname)に使用します。
@see Socket::Constants::IPPROTO_IPV6,
3542 -
Socket
:: IPV6 _ RTHDR -> Integer (349.0) -
Allows removal of sticky routing headers。 BasicSocket#getsockopt, BasicSocket#setsockopt の第2引数(optname)に使用します。
Allows removal of sticky routing headers。
BasicSocket#getsockopt, BasicSocket#setsockopt
の第2引数(optname)に使用します。
@see Socket::Constants::IPPROTO_IPV6,
3542 -
CSV
# col _ sep -> String (337.0) -
カラム区切り文字列として使用する文字列を返します。
カラム区切り文字列として使用する文字列を返します。
//emlist[例][ruby]{
require "csv"
users =<<-EOS
id|first name|last name|age
1|taro|tanaka|20
2|jiro|suzuki|18
3|ami|sato|19
4|yumi|adachi|21
EOS
csv = CSV.new(users, headers: true, col_sep: "|")
csv.col_sep # => "|"
csv.first.to_a # => [["id", "1"], ["first name", "taro"... -
CSV
:: FieldInfo # header -> String | nil (319.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
:: FieldInfo # index -> Integer (319.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.index
Date.parse(field)
end
p csv.first
# => 0
# => 1
# => #<CSV::Row "date1":#<Date: 2018-07-09 ((2458309j,0s... -
CSV
:: FieldInfo # line -> Integer (319.0) -
行番号を返します。
行番号を返します。
//emlist[例][ruby]{
require 'csv'
csv = CSV.new("date1,date2,date3\n2018-07-09,2018-07-10\n2018-08-09,2018-08-10", headers: true)
csv.convert do |field,field_info|
p field_info.line
Date.parse(field)
end
p csv.to_a
# => 2
# => 2
# => 3
# => 3
# => [#<CSV::Row "date1":#<Date: 2018-07... -
CSV
:: Table # inspect -> String (319.0) -
モードとサイズを US-ASCII な文字列で返します。
モードとサイズを US-ASCII な文字列で返します。
//emlist[][ruby]{
require 'csv'
csv = CSV.new("a,b,c\n1,2,3", headers: true)
table = csv.read
p table.inspect # => "#<CSV::Table mode:col_or_row row_count:2>"
//}