るりまサーチ (Ruby 2.1.0)

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

別のキーワード

  1. openssl p
  2. openssl p=
  3. fileutils mkdir_p
  4. rsa p
  5. kernel p

ライブラリ

クラス

モジュール

検索結果

URI::MailTo#headers -> [[String]] (54343.0)

自身のヘッダーを文字列の配列の配列として設定します。

自身のヘッダーを文字列の配列の配列として設定します。

例:
require 'uri'
m = URI.parse("mailto:ruby-list@ruby-lang.org?subject=subscribe&cc=myaddr")
p m.headers #=> [["subject", "subscribe"], ["cc", "myaddr"]]

Kernel#find_type(type, opt, *headers) -> Array (18928.0)

静的な型 type がシステムに存在するかどうか検査します。

静的な型 type がシステムに存在するかどうか検査します。

@param type 検査したい型の名前を指定します。

@param opt コンパイラに渡す追加のオプションを指定します。

@param headers 追加のヘッダを指定します。

@see Kernel#have_type

Kernel#find_type(type, opt, *headers) { ... } -> Array (18928.0)

静的な型 type がシステムに存在するかどうか検査します。

静的な型 type がシステムに存在するかどうか検査します。

@param type 検査したい型の名前を指定します。

@param opt コンパイラに渡す追加のオプションを指定します。

@param headers 追加のヘッダを指定します。

@see Kernel#have_type

Kernel#have_type(type, headers = nil, opt = "") -> bool (18928.0)

静的な型 type がシステムに存在するかどうか検査します。

静的な型 type がシステムに存在するかどうか検査します。

型 type がシステムに存在する場合は、グローバル変数 $defs に
"-DHAVE_type" を追加し、真を返します。型 type がシステムに存在しない場
合は、偽を返します。

例えば、

require 'mkmf'
have_type('foo') # => true

である場合、HAVE_TYPE_FOO をというプリプロセッサマクロをコンパイラに渡します。

@param type 検査したい型の名前を指定します。

@param headers 追加のヘッダを指定します。

@param opt ...

Kernel#have_type(type, headers = nil, opt = "") { ... } -> bool (18928.0)

静的な型 type がシステムに存在するかどうか検査します。

静的な型 type がシステムに存在するかどうか検査します。

型 type がシステムに存在する場合は、グローバル変数 $defs に
"-DHAVE_type" を追加し、真を返します。型 type がシステムに存在しない場
合は、偽を返します。

例えば、

require 'mkmf'
have_type('foo') # => true

である場合、HAVE_TYPE_FOO をというプリプロセッサマクロをコンパイラに渡します。

@param type 検査したい型の名前を指定します。

@param headers 追加のヘッダを指定します。

@param opt ...

絞り込み条件を変える

Kernel#try_type(type, headers = nil, opt = "") -> bool (18928.0)

Kernel#have_type を使ってください。

Kernel#have_type を使ってください。

@param type 検査したい型の名前を指定します。

@param headers 追加のヘッダを指定します。

@param opt コンパイラに渡す追加のオプションを指定します。

Kernel#try_type(type, headers = nil, opt = "") { ... } -> bool (18928.0)

Kernel#have_type を使ってください。

Kernel#have_type を使ってください。

@param type 検査したい型の名前を指定します。

@param headers 追加のヘッダを指定します。

@param opt コンパイラに渡す追加のオプションを指定します。

CSV::Table#empty? -> bool (18358.0)

ヘッダーを除いて、データがないときに true を返します。

ヘッダーを除いて、データがないときに true を返します。

Array#empty? に委譲しています。

//emlist[][ruby]{
require 'csv'
csv = CSV.new("a,b\n", headers: true)
table = csv.read
p table.empty? # => true
table << [1, 2]
p table.empty? # => false
//}

@see Array#empty?

CSV::Table#push(*rows) -> self (18358.0)

複数の行を追加するためのショートカットです。

複数の行を追加するためのショートカットです。

以下と同じです。
//emlist[][ruby]{
rows.each {|row| self << row }
//}

@param rows CSV::Row のインスタンスか配列を指定します。

//emlist[例][ruby]{
require 'csv'
csv = CSV.new("a,b,c\n1,2,3", headers: true)
table = csv.read
rows = [
CSV::Row.new(table.headers, [4, 5, 6]),
[7, 8, 9]
]

table.push(...

CSV#col_sep -> String (18340.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::Table#inspect -> String (18340.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>"
//}

WIN32OLE_PARAM#output? -> bool (18322.0)

パラメータがクライアントからの結果を受け取るためのものかを判定します。

パラメータがクライアントからの結果を受け取るためのものかを判定します。

OLEオートメーションのパラメータは、in(クライアントからサーバへ与える。
WIN32OLE_PARAM#input?が真)、out(サーバがクライアントへ与える。
WIN32OLE_PARAM#output?が真)および、inout(クライアントからサーバ
へ与え、サーバがクライアントへ与える)の3種類の方向属性のいずれかを持ち
ます。

output?メソッドはout属性またはinout属性なら真を返します。

@return メソッドの方向属性がoutまたはinoutならば真を返します。

tobj = W...

Kernel#have_macro(macro, headers = nil, opt = "") -> bool (676.0)

与えられた macro が共通のヘッダファイルか headers に定義されている場合は真を返します。 そうでない場合は偽を返します。

与えられた macro が共通のヘッダファイルか headers に定義されている場合は真を返します。
そうでない場合は偽を返します。

@param macro マクロの名前を指定します。

@param headers 追加のヘッダファイルを指定します。

@param opt C コンパイラに渡すコマンドライン引数を指定します。

Kernel#have_macro(macro, headers = nil, opt = "") { ... } -> bool (676.0)

与えられた macro が共通のヘッダファイルか headers に定義されている場合は真を返します。 そうでない場合は偽を返します。

与えられた macro が共通のヘッダファイルか headers に定義されている場合は真を返します。
そうでない場合は偽を返します。

@param macro マクロの名前を指定します。

@param headers 追加のヘッダファイルを指定します。

@param opt C コンパイラに渡すコマンドライン引数を指定します。

Kernel#check_signedness(type, headers = nil, opts = nil) -> "signed" | "unsigned" | nil (658.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 (658.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#convertible_int(type, headers = nil, opts = nil) (658.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) { ... } (658.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#check_sizeof(type, headers = nil) -> Integer | nil (628.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 (628.0)

与えられた型のサイズを返します。

与えられた型のサイズを返します。

型 type がシステムに存在する場合は、グローバル変数 $defs に
"-DSIZEOF_type=X" を追加し、型のサイズを返します。型 type がシステムに
存在しない場合は、nil を返します。

例えば、

require 'mkmf'
check_sizeof('mystruct') # => 12

である場合、SIZEOF_MYSTRUCT=12 というプリプロセッサマクロをコンパイラに渡します。

@param type 検査したい型を指定します。

@param headers 追加のヘッダファイルを指定します。

絞り込み条件を変える

Kernel#have_struct_member(type, member, headers = nil) -> bool (628.0)

member というメンバを持つ構造体 type がシステムに存在するかどうか検査します。

member というメンバを持つ構造体 type がシステムに存在するかどうか検査します。

member というメンバを持つ構造体 type がシステムに存在する場合は、
グローバル変数 $defs に "-DHAVE_type_member" を追加し、真を返します。
member というメンバを持つ構造体 type が存在しない場合は、偽を返します。

例えば

require 'mkmf'
have_struct_member('struct foo', 'bar') # => true

である場合、HAVE_STRUCT_FOO_BAR というプリプロセッサマクロをコンパ...

Kernel#have_struct_member(type, member, headers = nil) { ... } -> bool (628.0)

member というメンバを持つ構造体 type がシステムに存在するかどうか検査します。

member というメンバを持つ構造体 type がシステムに存在するかどうか検査します。

member というメンバを持つ構造体 type がシステムに存在する場合は、
グローバル変数 $defs に "-DHAVE_type_member" を追加し、真を返します。
member というメンバを持つ構造体 type が存在しない場合は、偽を返します。

例えば

require 'mkmf'
have_struct_member('struct foo', 'bar') # => true

である場合、HAVE_STRUCT_FOO_BAR というプリプロセッサマクロをコンパ...

Kernel#try_constant(const, headers = nil, opt = "") -> Integer | nil (628.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 (628.0)

定数 const がシステムに存在するかどうか検査します。 Kernel#have_const を使ってください。

定数 const がシステムに存在するかどうか検査します。
Kernel#have_const を使ってください。

@param const C 言語の定数名を指定します。

@param headers 追加のヘッダファイルを指定します。

@param opt コンパイラに渡すオプションを指定します。
$CFLAGS もコンパイラには渡されます。

@return 定数 const がシステムに存在する場合はその値を返します。
定数 const がシステムに存在しない場合は nil を返します。

Kernel#try_static_assert(expr, headers = nil, opt = "") -> bool (628.0)

@todo ???

@todo ???

...

@param expr C 言語の式を指定します。

@param headers 追加のヘッダファイルを指定します。

@param opt コンパイラに渡すオプションを指定します。
$CFLAGS もコンパイラには渡されます。

絞り込み条件を変える

Kernel#try_static_assert(expr, headers = nil, opt = "") { ... } -> bool (628.0)

@todo ???

@todo ???

...

@param expr C 言語の式を指定します。

@param headers 追加のヘッダファイルを指定します。

@param opt コンパイラに渡すオプションを指定します。
$CFLAGS もコンパイラには渡されます。

Kernel#have_header(header, preheaders = nil) -> bool (604.0)

ヘッダファイル header がシステムに存在するかどうか検査します。

ヘッダファイル header がシステムに存在するかどうか検査します。

ヘッダファイル header が存在する場合は、グローバル変数 $defs に
"-DHAVE_header" を追加して true を返します。ヘッダファイル header が存
在しない場合は $defs は変更せず false を返します。

@param header 検査したいヘッダファイルを指定します。

@param preheaders ヘッダファイルを検査する前に読み込んでおくヘッダファイルを指定します。

Kernel#have_header(header, preheaders = nil) { ... } -> bool (604.0)

ヘッダファイル header がシステムに存在するかどうか検査します。

ヘッダファイル header がシステムに存在するかどうか検査します。

ヘッダファイル header が存在する場合は、グローバル変数 $defs に
"-DHAVE_header" を追加して true を返します。ヘッダファイル header が存
在しない場合は $defs は変更せず false を返します。

@param header 検査したいヘッダファイルを指定します。

@param preheaders ヘッダファイルを検査する前に読み込んでおくヘッダファイルを指定します。

CSV::Table#to_csv(options = Hash.new) -> String (394.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 (394.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#convert {|field, field_info| ... } (76.0)

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

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

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

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

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

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

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

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

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

CSV#convert(name) (76.0)

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

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

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

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

CSV#each {|row| ... } -> nil (58.0)

各行に対してブロックを評価します。

各行に対してブロックを評価します。

データソースは読み込み用にオープンされていなければなりません。

//emlist[例 CSV.new 時に :header => true を指定した場合][ruby]{
require "csv"

users = <<CSV
id,first name,last name,age
1,taro,tanaka,20
2,jiro,suzuki,18
3,ami,sato,19
4,yumi,adachi,21
CSV
csv = CSV.new(users, headers: true)
csv.each do |row|
p row
end

...

CSV::FieldInfo#header -> String | nil (58.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 (58.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 (58.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#length -> Integer (40.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 (40.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