るりまサーチ (Ruby 2.3.0)

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

別のキーワード

  1. etc sc_xopen_enh_i18n
  2. rsa n=
  3. rsa n
  4. openssl n
  5. openssl n=

ライブラリ

クラス

キーワード

検索結果

<< 1 2 3 ... > >>

Socket::AncillaryData#int -> Integer (73279.0)

自身が保持している cmsg data (データ) を整数の形で返します。

自身が保持している cmsg data (データ) を整数の形で返します。

整数データのサイズおよびエンディアンは実行するホストによって異なります。

require 'socket'

ancdata = Socket::AncillaryData.int(:UNIX, :SOCKET, :RIGHTS, STDERR.fileno)
p ancdata.int #=> 2

@raise TypeError cmgs data のサイズが int のバイト数と異なる場合に発生します
@see Socket::AncillaryData.new Socket::Ancillar...

Socket::Option#int -> Integer (73225.0)

オプションのデータ(内容)を整数に変換して返します。

オプションのデータ(内容)を整数に変換して返します。

@raise TypeError dataのバイト数が不適切である(sizeof(int)と異なる)場合に発生します
@see Socket::Option#data

Gem::Commands::DependencyCommand#print_dependencies(spec, level = 0) -> String (63604.0)

依存関係を表す文字列を返します。

依存関係を表す文字列を返します。

@param spec Gem::Specification のインスタンスを指定します。

@param level 依存関係の深さを指定します。

Object#untaint -> self (54904.0)

オブジェクトの「汚染マーク」を取り除きます。

オブジェクトの「汚染マーク」を取り除きます。

汚染マークを取り除くことによる危険性はプログラマが責任を負う必要が
あります。

オブジェクトの汚染に関してはspec/safelevelを参照してください。


ruby -e 'p ARGV[0].tainted?;t=+ARGV[0];t.untaint;p t.tainted?' hoge
# => true
# false

このメソッドは Ruby 2.7 から deprecated で、Ruby 3.2 で削除予定です。


@see Object#taint,Object#tainted?

Gem::UserInteraction#terminate_interaction(*args) -> () (54604.0)

アプリケーションを終了します。

アプリケーションを終了します。

@param args 委譲先のメソッドに与える引数です。

絞り込み条件を変える

Integer#integer? -> true (54604.0)

常に真を返します。

常に真を返します。

//emlist[][ruby]{
1.integer? # => true
1.0.integer? # => false
//}

Kernel#check_signedness(type, headers = nil, opts = nil) -> "signed" | "unsigned" | nil (46300.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 (46300.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...

Pathname#mountpoint? -> bool (45904.0)

self がマウントポイントであれば真を返します。

self がマウントポイントであれば真を返します。

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

path = Pathname("/")
path.mountpoint? # => true
path = Pathname("/usr")
path.mountpoint? # => false
//}

WIN32OLE_METHOD#event_interface -> String | nil (45904.0)

メソッドがイベントの場合、イベントのインターフェイス名を取得します。

メソッドがイベントの場合、イベントのインターフェイス名を取得します。

@return メソッドがイベントであれば、イベントのインターフェイス名を返し
ます。イベントでなければnilを返します。

tobj = WIN32OLE_TYPE.new('Microsoft Excel 14.0 Object Library', 'Workbook')
method = WIN32OLE_METHOD.new(tobj, 'SheetActivate')
puts method.event_interface # => WorkbookEvents

絞り込み条件を変える

Gem::Requirement#pretty_print(pp) -> String (45604.0)

わかりやすい形で、条件を表す文字列を返します。 pp メソッドで出力する際に、内部で用いられます。

わかりやすい形で、条件を表す文字列を返します。
pp メソッドで出力する際に、内部で用いられます。

@param PP :PP オブジェクトを指定します。

//emlist[][ruby]{
require 'pp'

req = Gem::Requirement.new(["< 5.0", ">= 1.9"])
pp req # => Gem::Requirement.new(["< 5.0", ">= 1.9"])
//}

IRB::Context#ignore_sigint -> bool (45604.0)

Ctrl-C が入力された時に irb を終了するかどうかを返します。

Ctrl-C が入力された時に irb を終了するかどうかを返します。

false の時は irb を終了します。true の時は以下のように動作します。

: 入力中
これまで入力したものをキャンセルしトップレベルに戻る.
: 実行中
実行を中止する.

デフォルト値は true です。

@see IRB::Context#ignore_sigint=

IRB::Context#ignore_sigint=(val) (45604.0)

Ctrl-C が入力された時に irb を終了するかどうかを val に設定します。

Ctrl-C が入力された時に irb を終了するかどうかを val に設定します。

.irbrc ファイル中で IRB.conf[:IGNORE_SIGINT] を設定する事でも同様の操作
が行えます。

@param val false を指定した場合、Ctrl-C の入力時に irb を終了します。
true を指定した場合、Ctrl-C の入力時に以下のように動作します。

: 入力中
これまで入力したものをキャンセルしトップレベルに戻る.
: 実行中
実行を中止する.

@see IRB::Context#ignore_sigint

IRB::Context#ignore_sigint? -> bool (45604.0)

Ctrl-C が入力された時に irb を終了するかどうかを返します。

Ctrl-C が入力された時に irb を終了するかどうかを返します。

false の時は irb を終了します。true の時は以下のように動作します。

: 入力中
これまで入力したものをキャンセルしトップレベルに戻る.
: 実行中
実行を中止する.

デフォルト値は true です。

@see IRB::Context#ignore_sigint=

StringIO#internal_encoding -> Encoding (45604.0)

現在の内部エンコーディングを返します。

現在の内部エンコーディングを返します。

絞り込み条件を変える

Prime#int_from_prime_division(pd) -> Integer (37333.0)

素因数分解された結果を元の数値に戻します。

素因数分解された結果を元の数値に戻します。

引数が [[p_1, e_1], [p_2, e_2], ...., [p_n, e_n]] のようであるとき、
結果は p_1**e_1 * p_2**e_2 * .... * p_n**e_n となります。

@param pd 整数のペアの配列を指定します。含まれているペアの第一要素は素因数を、
第二要素はその素因数の指数をあらわします。

//emlist[例][ruby]{
require 'prime'
Prime.int_from_prime_division([[2,2], [3,1]]) #=> 12
P...

Numeric#to_int -> Integer (37243.0)

self.to_i と同じです。

self.to_i と同じです。

//emlist[例][ruby]{
(2+0i).to_int # => 2
Rational(3).to_int # => 3
//}

Object#to_int -> Integer (37225.0)

オブジェクトの Integer への暗黙の変換が必要なときに内部で呼ばれます。 デフォルトでは定義されていません。

オブジェクトの Integer への暗黙の変換が必要なときに内部で呼ばれます。
デフォルトでは定義されていません。

説明のためここに記載してありますが、
このメソッドは実際には Object クラスには定義されていません。
必要に応じてサブクラスで定義すべきものです。

このメソッドを定義する条件は、
* 整数が使われるすべての場面で代置可能であるような、
* 整数そのものとみなせるようなもの
という厳しいものになっています。

//emlist[][ruby]{
class Foo
def to_int
1
end
end

ary = [:a, :b, :c]
p(...

Fiddle::Pointer#to_int -> Integer (37207.0)

自身が指すアドレスを整数で返します。

自身が指すアドレスを整数で返します。

Matrix#find_index(selector = :all) {|e| ... } -> [Integer, Integer] | nil (37204.0)

指定した値と一致する要素の位置を [row, column] という配列で返します。 ブロックを与えた場合は各要素を引数としてブロックを呼び出し、 返り値が真であった要素の位置を返します。

指定した値と一致する要素の位置を [row, column] という配列で返します。
ブロックを与えた場合は各要素を引数としてブロックを呼び出し、
返り値が真であった要素の位置を返します。

複数の位置で値が一致する/ブロックが真を返す、場合は最初
に見つかった要素の位置を返します。

selector で行列のどの部分を探すかを指定します。この引数の意味は
Matrix#each を参照してください。

//emlist[例][ruby]{
require 'matrix'
Matrix[ [1,2], [3,4] ].index(&:even?) # => [0, 1]
Matrix[ ...

絞り込み条件を変える

Matrix#find_index(value, selector = :all) -> [Integer, Integer] | nil (37204.0)

指定した値と一致する要素の位置を [row, column] という配列で返します。 ブロックを与えた場合は各要素を引数としてブロックを呼び出し、 返り値が真であった要素の位置を返します。

指定した値と一致する要素の位置を [row, column] という配列で返します。
ブロックを与えた場合は各要素を引数としてブロックを呼び出し、
返り値が真であった要素の位置を返します。

複数の位置で値が一致する/ブロックが真を返す、場合は最初
に見つかった要素の位置を返します。

selector で行列のどの部分を探すかを指定します。この引数の意味は
Matrix#each を参照してください。

//emlist[例][ruby]{
require 'matrix'
Matrix[ [1,2], [3,4] ].index(&:even?) # => [0, 1]
Matrix[ ...

String#codepoints -> [Integer] (37204.0)

文字列の各コードポイントの配列を返します。(self.each_codepoint.to_a と同じです)

文字列の各コードポイントの配列を返します。(self.each_codepoint.to_a と同じです)

//emlist[例][ruby]{
#coding:UTF-8
"hello わーるど".codepoints
# => [104, 101, 108, 108, 111, 32, 12431, 12540, 12427, 12393]
//}

ブロックが指定された場合は String#each_codepoint と同じように動作します。

Ruby 2.6 までは deprecated の警告が出ますが、Ruby 2.7 で警告は削除されました。

@see String#e...

String#codepoints {|codepoint| block } -> self (37204.0)

文字列の各コードポイントの配列を返します。(self.each_codepoint.to_a と同じです)

文字列の各コードポイントの配列を返します。(self.each_codepoint.to_a と同じです)

//emlist[例][ruby]{
#coding:UTF-8
"hello わーるど".codepoints
# => [104, 101, 108, 108, 111, 32, 12431, 12540, 12427, 12393]
//}

ブロックが指定された場合は String#each_codepoint と同じように動作します。

Ruby 2.6 までは deprecated の警告が出ますが、Ruby 2.7 で警告は削除されました。

@see String#e...

String#each_codepoint {|codepoint| block } -> self (37204.0)

文字列の各コードポイントに対して繰り返します。

文字列の各コードポイントに対して繰り返します。

UTF-8/UTF-16(BE|LE)/UTF-32(BE|LE) 以外のエンコーディングに対しては
各文字のバイナリ表現由来の値になります。

//emlist[例][ruby]{
#coding:UTF-8
"hello わーるど".each_codepoint.to_a
# => [104, 101, 108, 108, 111, 32, 12431, 12540, 12427, 12393]
"hello わーるど".encode('euc-jp').each_codepoint.to_a
# => [104, 101, 108, 1...

StringIO#codepoints {|codepoint| ... } -> self (37204.0)

自身の各コードポイントに対して繰り返します。

自身の各コードポイントに対して繰り返します。

@see IO#each_codepoint

絞り込み条件を変える

StringIO#each_codepoint {|codepoint| ... } -> self (37204.0)

自身の各コードポイントに対して繰り返します。

自身の各コードポイントに対して繰り返します。

@see IO#each_codepoint

StringScanner#pointer -> Integer (37204.0)

現在のスキャンポインタのインデックスを返します。

現在のスキャンポインタのインデックスを返します。

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

s = StringScanner.new('test string')
s.pos # => 0
s.scan(/\w+/) # => "test"
s.pos # => 4
s.scan(/\w+/) # => nil
s.pos # => 4
s.scan(/\s+/) # => " "
s.pos # => 5
//}

@see StringScanner#charpos

WEBrick::HTTPRequest#content_length -> Integer (37204.0)

リクエストの Content-Length ヘッダの値を整数で返します。リクエストに Content-Length ヘッダ が含まれていない場合は 0 を返します。

リクエストの Content-Length ヘッダの値を整数で返します。リクエストに Content-Length ヘッダ
が含まれていない場合は 0 を返します。

Array#find_index {|item| ...} -> Integer | nil (36904.0)

条件に一致する最初の要素の位置を返します。

条件に一致する最初の要素の位置を返します。

@param val 位置を知りたいオブジェクトを指定します。

指定された val と == で等しい最初の要素の位置を返します。
等しい要素がひとつもなかった場合は nil を返します。

//emlist[例][ruby]{
p [1, 0, 0, 1, 0].index(1) #=> 0
p [1, 0, 0, 0, 0].index(1) #=> 0
p [0, 0, 0, 0, 0].index(1) #=> nil
//}

ブロックが与えられた場合には、各要素を引数として順にブロックを実行し、
ブロックが真を返した最初...

Array#find_index(val) -> Integer | nil (36904.0)

条件に一致する最初の要素の位置を返します。

条件に一致する最初の要素の位置を返します。

@param val 位置を知りたいオブジェクトを指定します。

指定された val と == で等しい最初の要素の位置を返します。
等しい要素がひとつもなかった場合は nil を返します。

//emlist[例][ruby]{
p [1, 0, 0, 1, 0].index(1) #=> 0
p [1, 0, 0, 0, 0].index(1) #=> 0
p [0, 0, 0, 0, 0].index(1) #=> nil
//}

ブロックが与えられた場合には、各要素を引数として順にブロックを実行し、
ブロックが真を返した最初...

絞り込み条件を変える

StringScanner#pointer=(n) (36694.0)

スキャンポインタのインデックスを n にセットします。

スキャンポインタのインデックスを n にセットします。

@param n 整数で、バイト単位で指定します。
負数を指定すると文字列の末尾からのオフセットとして扱います。
@raise RangeError マッチ対象の文字列の長さを超える値を指定すると発生します。

@return n を返します。

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

s = StringScanner.new('test string')
p s.scan(/\w+/) # => "test"
p s.pos = 1 # => 1
p s.scan(/\...

Kernel#convertible_int(type, headers = nil, opts = nil) (36658.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) { ... } (36658.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...

ARGF.class#each_codepoint -> Enumerator (36640.0)

self の各コードポイントに対して繰り返しブロックを呼びだします。

self の各コードポイントに対して繰り返しブロックを呼びだします。

ブロックの引数にはコードポイントを表す整数が渡されます。

ブロックを省略した場合には、Enumerator を返します。

例:
# $ echo "line1\n" > test1.txt
# $ echo "line2\n" > test2.txt
# $ ruby test.rb test1.txt test2.txt

# test.rb
ARGF.each_codepoint # => #<Enumerator: ARGF:each_codepoint>
...

ARGF.class#each_codepoint { |c| ... } -> self (36640.0)

self の各コードポイントに対して繰り返しブロックを呼びだします。

self の各コードポイントに対して繰り返しブロックを呼びだします。

ブロックの引数にはコードポイントを表す整数が渡されます。

ブロックを省略した場合には、Enumerator を返します。

例:
# $ echo "line1\n" > test1.txt
# $ echo "line2\n" > test2.txt
# $ ruby test.rb test1.txt test2.txt

# test.rb
ARGF.each_codepoint # => #<Enumerator: ARGF:each_codepoint>
...

絞り込み条件を変える

CGI#print(*strings) (36622.0)

@todo

@todo

引数の文字列を標準出力に出力します。
cgi.print は $DEFAULT_OUTPUT.print と等価です。

例:
cgi = CGI.new
cgi.print "This line is a part of content body.\r\n"

IO#print(*arg) -> nil (36622.0)

引数を IO ポートに順に出力します。引数を省略した場合は、$_ を出力します。

引数を IO ポートに順に出力します。引数を省略した場合は、$_ を出力します。

@param arg Kernel.#print と同じです。

@raise IOError 自身が書き込み用にオープンされていなければ発生します。

@raise Errno::EXXX 出力に失敗した場合に発生します。

//emlist[例][ruby]{
$stdout.print("This is ", 100, " percent.\n") # => This is 100 percent.
//}

@see Kernel.#print

Zlib::GzipWriter#printf(format, *args) -> nil (36622.0)

C 言語の printf と同じように、format に従い引数 を文字列に変換して、自身に出力します。

C 言語の printf と同じように、format に従い引数
を文字列に変換して、自身に出力します。

@param format フォーマット文字列を指定します。print_format を参照してください。

@param args フォーマットされるオブジェクトを指定します。

require 'zlib'

filename='hoge1.gz'
fw = File.open(filename, "w")
Zlib::GzipWriter.wrap(fw, Zlib::BEST_COMPRESSION){|gz|
gz.printf("\n%9s", "b...

IPAddr#ip6_int -> String (36607.0)

IPv6 なら 1886 互換形式で DNS 逆引きのための文字列を返します。 IPv4 の場合は例外を発生します。

IPv6 なら 1886 互換形式で DNS 逆引きのための文字列を返します。
IPv4 の場合は例外を発生します。

Integer#to_int -> self (36607.0)

self を返します。

self を返します。

//emlist[][ruby]{
10.to_i # => 10
//}

絞り込み条件を変える

ARGF.class#codepoints -> Enumerator (36604.0)

このメソッドは obsolete です。 代わりに ARGF.class#each_codepoint を使用してください。 使用すると警告メッセージが表示されます。

このメソッドは obsolete です。
代わりに ARGF.class#each_codepoint を使用してください。
使用すると警告メッセージが表示されます。

ARGF.class#codepoints { |c| ... } -> self (36604.0)

このメソッドは obsolete です。 代わりに ARGF.class#each_codepoint を使用してください。 使用すると警告メッセージが表示されます。

このメソッドは obsolete です。
代わりに ARGF.class#each_codepoint を使用してください。
使用すると警告メッセージが表示されます。

ARGF.class#internal_encoding -> Encoding | nil (36604.0)

ARGF から読み込んだ文字列の内部エンコーディングを返します。 内部エンコーディングが指定されていない場合は nil を返します。

ARGF から読み込んだ文字列の内部エンコーディングを返します。
内部エンコーディングが指定されていない場合は nil を返します。

まだ読み込み処理を始めていない場合は Encoding.default_external を返します。

ARGF.class#set_encoding で設定します。


例:
# $ ruby -Eutf-8 test.rb

# test.rb
ARGF.internal_encoding # => #<Encoding:UTF-8>
ARGF.set_encoding('utf-8','ascii')
ARG...

ARGF.class#print(*arg) -> nil (36604.0)

引数を順に処理対象のファイルに出力します。

引数を順に処理対象のファイルに出力します。

c:ARGF#inplace時にのみ使用できます。
また $stdout への代入の影響を受けません。
それ以外は Kernel.#print と同じです。

@param arg 出力するオブジェクトを任意個指定します。

ARGF.class#printf(format, *arg) -> nil (36604.0)

C 言語の printf と同じように、format に従い引数を 文字列に変換して処理対象のファイルに出力します。

C 言語の printf と同じように、format に従い引数を
文字列に変換して処理対象のファイルに出力します。

c:ARGF#inplace時にのみ使用できます。
また $stdout への代入の影響を受けません。
それ以外は出力先を指定しない形式の Kernel.#printf と同じです。

@param format フォーマット文字列です。
@param arg フォーマットされる引数です。

絞り込み条件を変える

CGI::QueryExtension#gateway_interface -> String (36604.0)

ENV['GATEWAY_INTERFACE'] を返します。

ENV['GATEWAY_INTERFACE'] を返します。

CSV#internal_encoding -> Encoding | nil (36604.0)

IO#internal_encoding に委譲します。

IO#internal_encoding に委譲します。


@see IO#internal_encoding

Gem::QuickLoader#calculate_integers_for_gem_version (36604.0)

prelude.c で定義されている内部用のメソッドです。

prelude.c で定義されている内部用のメソッドです。

Gem::StreamUI#terminate_interaction(status = 0) -> () (36604.0)

アプリケーションを終了します。

アプリケーションを終了します。

@param status 終了ステータスを指定します。デフォルトは 0 (成功) です。

@raise Gem::SystemExitException このメソッドを呼び出すと必ず発生する例外です。

IO#codepoints -> Enumerator (36604.0)

このメソッドは obsolete です。 代わりに IO#each_codepoint を使用してください。

このメソッドは obsolete です。
代わりに IO#each_codepoint を使用してください。

使用すると警告メッセージが表示されます。

IO の各コードポイントに対して繰り返しブロックを呼びだします。

ブロックの引数にはコードポイントを表す整数が渡されます。

ブロックを省略した場合には、Enumerator を返します。


@see IO#each_codepoint

絞り込み条件を変える

IO#codepoints {|c| ... } -> self (36604.0)

このメソッドは obsolete です。 代わりに IO#each_codepoint を使用してください。

このメソッドは obsolete です。
代わりに IO#each_codepoint を使用してください。

使用すると警告メッセージが表示されます。

IO の各コードポイントに対して繰り返しブロックを呼びだします。

ブロックの引数にはコードポイントを表す整数が渡されます。

ブロックを省略した場合には、Enumerator を返します。


@see IO#each_codepoint

IO#each_codepoint -> Enumerator (36604.0)

IO の各コードポイントに対して繰り返しブロックを呼びだします。

IO の各コードポイントに対して繰り返しブロックを呼びだします。

ブロックの引数にはコードポイントを表す整数が渡されます。

ブロックを省略した場合には、Enumerator を返します。

//emlist[例][ruby]{
IO.write("testfile", "abcdeあ")
File.open("testfile") do |f|
f.each_codepoint { |i| p i }
end
# => 97
# 98
# 99
# 100
# 101
# 12354
//}

IO#each_codepoint {|c| ... } -> self (36604.0)

IO の各コードポイントに対して繰り返しブロックを呼びだします。

IO の各コードポイントに対して繰り返しブロックを呼びだします。

ブロックの引数にはコードポイントを表す整数が渡されます。

ブロックを省略した場合には、Enumerator を返します。

//emlist[例][ruby]{
IO.write("testfile", "abcdeあ")
File.open("testfile") do |f|
f.each_codepoint { |i| p i }
end
# => 97
# 98
# 99
# 100
# 101
# 12354
//}

IO#internal_encoding -> Encoding | nil (36604.0)

IO の内部エンコーディングを返します。 内部エンコーディングが指定されていない場合は nil を返します。

IO の内部エンコーディングを返します。
内部エンコーディングが指定されていない場合は nil を返します。

//emlist[例][ruby]{
IO.write("testfile", "abcde")
File.open("testfile") do |f|
p f.internal_encoding # => nil
f.set_encoding("ASCII-8BIT", "EUC-JP")
p f.internal_encoding # => #<Encoding:EUC-JP>
end
//}

IO#printf(format, *arg) -> nil (36604.0)

C 言語の printf と同じように、format に従い引数 を文字列に変換して、self に出力します。

C 言語の printf と同じように、format に従い引数
を文字列に変換して、self に出力します。

第一引数に IO を指定できないこと、引数を省略できないことを除けば Kernel.#printf と同じです。

@param format Kernel.#printf と同じです。print_format を参照してください。

@param arg Kernel.#printf と同じです。

@raise IOError 自身が書き込み用にオープンされていなければ発生します。

@raise Errno::EXXX 出力に失敗した場合に発生します。


@see Ker...

絞り込み条件を変える

IRB::OutputMethod#print(*objs) (36604.0)

NotImplementedError が発生します。

NotImplementedError が発生します。

@param objs 任意のオブジェクトを指定します。

@raise NotImplementedError 必ず発生します。

IRB::OutputMethod#printn(*objs) -> nil (36604.0)

各 obj を self に出力し、最後に改行を出力します。

各 obj を self に出力し、最後に改行を出力します。

@param objs 任意のオブジェクトを指定します。

IRB::StdioOutputMethod#print(*objs) -> nil (36604.0)

引数を標準出力に出力します。

引数を標準出力に出力します。

@param objs 任意のオブジェクトを指定します。

Numeric#integer? -> bool (36604.0)

自身が Integer かそのサブクラスのインスタンスの場合にtrue を返し ます。そうでない場合に false を返します。

自身が Integer かそのサブクラスのインスタンスの場合にtrue を返し
ます。そうでない場合に false を返します。

Numeric のサブクラスは、このメソッドを適切に再定義しなければなりません。

//emlist[例][ruby]{
(1.0).integer? #=> false
(1).integer? #=> true
//}

@see Numeric#real?

Object#pretty_print(pp) -> () (36604.0)

PP.pp や Kernel.#pp がオブジェクトの内容を出力するときに 呼ばれるメソッドです。PP オブジェクト pp を引数として呼ばれます。

PP.pp や Kernel.#pp がオブジェクトの内容を出力するときに
呼ばれるメソッドです。PP オブジェクト pp を引数として呼ばれます。

あるクラスの pp の出力をカスタマイズしたい場合は、このメソッドを再定義します。
そのとき pretty_print メソッドは指定された pp に対して表示したい自身の内容を追加して
いかなければいけません。いくつかの組み込みクラスについて、
pp ライブラリはあらかじめ pretty_print メソッドを定義しています。

@param pp PP オブジェクトです。

//emlist[][ruby]{
require 'pp'

...

絞り込み条件を変える

Object#pretty_print_cycle(pp) -> () (36604.0)

プリティプリント時にオブジェクトの循環参照が検出された場合、 Object#pretty_print の代わりに呼ばれるメソッドです。

プリティプリント時にオブジェクトの循環参照が検出された場合、
Object#pretty_print の代わりに呼ばれるメソッドです。

あるクラスの pp の出力をカスタマイズしたい場合は、
このメソッドも再定義する必要があります。

@param pp PP オブジェクトです。

//emlist[][ruby]{
class Array
def pretty_print_cycle(q)
q.text(empty? ? '[]' : '[...]')
end
end
//}

@see Object#pretty_print

Object#pretty_print_inspect -> String (36604.0)

Object#pretty_print を使って Object#inspect と同様に オブジェクトを人間が読める形式に変換した文字列を返します。

Object#pretty_print を使って Object#inspect と同様に
オブジェクトを人間が読める形式に変換した文字列を返します。

出力する全てのオブジェクトに Object#pretty_print が定義されている必要があります。
そうでない場合には RuntimeError が発生します。

@raise RuntimeError 出力する全てのオブジェクトに Object#pretty_print が定義されて
いない場合に発生します。

Object#pretty_print_instance_variables -> [String | Symbol] (36604.0)

プリティプリント時に表示すべき自身のインスタンス変数名の配列をソートして返します。 返されたインスタンス変数はプリティプリント時に表示されます。

プリティプリント時に表示すべき自身のインスタンス変数名の配列をソートして返します。
返されたインスタンス変数はプリティプリント時に表示されます。

pp に表示したくないインスタンス変数がある場合にこのメソッドを再定義します。

Object#taint -> self (36604.0)

このメソッドは Ruby 2.7 から deprecated で、Ruby 3.2 で削除予定です。

このメソッドは Ruby 2.7 から deprecated で、Ruby 3.2 で削除予定です。

オブジェクトの「汚染マーク」をセットします。

環境変数(ENVで得られる文字列)など一部のオブジェクトは最初から汚染されています。
オブジェクトの汚染に関してはspec/safelevelを参照してください。

//emlist[][ruby]{
$SAFE = 1

some = "puts '@&%&(#!'"
p some.tainted? #=> false
eval(some) #=> @&%&(#!

some.taint
p some.tainted? #=> true
e...

Object#tainted? -> bool (36604.0)

オブジェクトの「汚染マーク」がセットされている時真を返します。

オブジェクトの汚染に関してはspec/safelevelを参照してください。

//emlist[][ruby]{
p String.new.tainted? #=> false
p ENV['OS'].tainted? #=> true
//}

このメソッドは Ruby 2.7から deprecated で、Ruby 3.2 で削除予定です。

@see Object#taint,Object#untaint

絞り込み条件を変える

OpenSSL::BN#pretty_print(pp) (36604.0)

Kernel.#pp でオブジェクトの内容を出力するときに、内部で呼ばれるメソッドです。

Kernel.#pp でオブジェクトの内容を出力するときに、内部で呼ばれるメソッドです。

//emlist[][ruby]{
require 'pp'
require 'openssl'

pp 5.to_bn #=> #<OpenSSL::BN 5>
pp (-5).to_bn #=> #<OpenSSL::BN -5>
//}

@param pp PP クラスのインスタンスオブジェクト

OpenSSL::Buffering#print(*args) -> nil (36604.0)

args を順に出力します。

args を順に出力します。

args の各要素を to_s で文字列に変換して
出力します。
IO#print とほぼ同様ですが、引数を省略した場合に $_ を出力する
機能はありません。

@param args 出力するオブジェクト

OpenSSL::Buffering#printf(format, *args) -> nil (36604.0)

format に従い引数 args を文字列に変換して 出力します。

format に従い引数 args を文字列に変換して
出力します。

IO#printf と同様です。

@param format 出力フォーマット文字列
@param arg 出力するオブジェクト
@see Kernel.#printf

OpenSSL::PKey::EC::Group#point_conversion_form -> Symbol (36604.0)

点のエンコーディング方式を返します。

点のエンコーディング方式を返します。

以下のいずれかを返します。
* :compressed
* :uncompressed
* :hybrid
詳しくは X9.62 (ECDSA) などを参照してください。

@raise OpenSSL::PKey::EC::Group::Error 得られたエンコーディングが未知の値であった
場合に発生します。
@see OpenSSL::PKey::EC::Group#point_conversion_form=

OpenSSL::PKey::EC::Group#point_conversion_form=(sym) (36604.0)

点のエンコーディング方式を設定します。

点のエンコーディング方式を設定します。

以下のいずれかを設定します。
* :compressed
* :uncompressed
* :hybrid
詳しくは X9.62 (ECDSA) などを参照してください。

@param sym 設定する方式(Symbol)
@see OpenSSL::PKey::EC::Group#point_conversion_form

絞り込み条件を変える

PrettyPrint#indent -> Integer (36604.0)

現在のインデントの深さを返します。

現在のインデントの深さを返します。

PrettyPrint#newline -> String (36604.0)

自身の改行文字を返します。

自身の改行文字を返します。

Prime::EratosthenesGenerator#next -> Integer (36604.0)

次の(擬似)素数を返します。なお、この実装においては擬似素数は真に素数です。

次の(擬似)素数を返します。なお、この実装においては擬似素数は真に素数です。

また内部的な列挙位置を進めます。

//emlist[例][ruby]{
require 'prime'
generator = Prime::EratosthenesGenerator.new
p generator.next #=> 2
p generator.next #=> 3
p generator.succ #=> 5
p generator.succ #=> 7
p generator.next #=> 11
//}

RDoc::Stats#print -> () (36604.0)

自身の持つ情報を標準出力に表示します。

自身の持つ情報を標準出力に表示します。

Rake::TaskManager#intern(task_class, task_name) -> Rake::Task (36604.0)

タスクを検索します。

タスクを検索します。

タスクが見つかれば見つかったタスクを返します。
見つからなければ、与えられた型のタスクを作成して返します。

@param task_class タスクのクラスを指定します。

@param task_name タスクの名前を指定します。

//emlist[][ruby]{
# Rakefile での記載例とする

task default: :test_rake_app

task :test_rake_app do |task|
task.application.intern(Rake::Task, "test_rake_app") # => <Rake::...

絞り込み条件を変える

Set#disjoint?(set) -> bool (36604.0)

self と set が互いに素な集合である場合に true を返します。

self と set が互いに素な集合である場合に true を返します。

逆に self と set の共通集合かを確認する場合には Set#intersect? を
使用します。

@param self Set オブジェクトを指定します。
@raise ArgumentError 引数が Set オブジェクトでない場合に発生します。

//emlist[][ruby]{
require 'set'
p Set[1, 2, 3].disjoint? Set[3, 4] # => false
p Set[1, 2, 3].disjoint? Set[4, 5] # => true
//}...

Set#intersect?(set) -> bool (36604.0)

self と set の共通要素がある場合に true を返します。

self と set の共通要素がある場合に true を返します。

@param self Set オブジェクトを指定します。
@raise ArgumentError 引数が Set オブジェクトでない場合に発生します。

require 'set'
p Set[1, 2, 3].intersect?(Set[3, 4]) # => true
p Set[1, 2, 3].intersect?(Set[4, 5]) # => false

@see Set#intersection, Set#disjoint?

Shell#check_point (36604.0)

@todo

@todo

Shell::CommandProcessor#check_point (36604.0)

@todo

@todo

Shell::Filter#check_point (36604.0)

@todo

@todo

絞り込み条件を変える

String#each_codepoint -> Enumerator (36604.0)

文字列の各コードポイントに対して繰り返します。

文字列の各コードポイントに対して繰り返します。

UTF-8/UTF-16(BE|LE)/UTF-32(BE|LE) 以外のエンコーディングに対しては
各文字のバイナリ表現由来の値になります。

//emlist[例][ruby]{
#coding:UTF-8
"hello わーるど".each_codepoint.to_a
# => [104, 101, 108, 108, 111, 32, 12431, 12540, 12427, 12393]
"hello わーるど".encode('euc-jp').each_codepoint.to_a
# => [104, 101, 108, 1...

String#intern -> Symbol (36604.0)

文字列に対応するシンボル値 Symbol を返します。

文字列に対応するシンボル値 Symbol を返します。

なお、このメソッドの逆にシンボルに対応する文字列を得るには
Symbol#to_s または Symbol#id2name を使います。

シンボル文字列にはヌルキャラクタ("\0")、空の文字列の使用も可能です。

//emlist[例][ruby]{
p "foo".intern # => :foo
p "foo".intern.to_s == "foo" # => true
//}

StringIO#codepoints -> Enumerator (36604.0)

自身の各コードポイントに対して繰り返します。

自身の各コードポイントに対して繰り返します。

@see IO#each_codepoint

StringIO#each_codepoint -> Enumerator (36604.0)

自身の各コードポイントに対して繰り返します。

自身の各コードポイントに対して繰り返します。

@see IO#each_codepoint

StringIO#print() -> nil (36604.0)

自身に引数を順に出力します。引数を省略した場合は、$_ を出力します。 引数の扱いは Kernel.#print を参照して下さい。

自身に引数を順に出力します。引数を省略した場合は、$_ を出力します。
引数の扱いは Kernel.#print を参照して下さい。

@param obj 書き込みたいオブジェクトを指定します。

@raise IOError 自身が書き込み用にオープンされていなければ発生します。

//emlist[例][ruby]{
require "stringio"
a = StringIO.new("", 'r+')
a.print("hoge", "bar", "foo")
a.string #=> "hogebarfoo"
//}

絞り込み条件を変える

StringIO#print(*obj) -> nil (36604.0)

自身に引数を順に出力します。引数を省略した場合は、$_ を出力します。 引数の扱いは Kernel.#print を参照して下さい。

自身に引数を順に出力します。引数を省略した場合は、$_ を出力します。
引数の扱いは Kernel.#print を参照して下さい。

@param obj 書き込みたいオブジェクトを指定します。

@raise IOError 自身が書き込み用にオープンされていなければ発生します。

//emlist[例][ruby]{
require "stringio"
a = StringIO.new("", 'r+')
a.print("hoge", "bar", "foo")
a.string #=> "hogebarfoo"
//}

StringIO#printf(format, *obj) -> nil (36604.0)

指定されたフォーマットに従い各引数 obj を文字列に変換して、自身に出力します。

指定されたフォーマットに従い各引数 obj を文字列に変換して、自身に出力します。

@param format 文字列のフォーマットを指定します。Kernel.#format を参照して下さい。

@param obj 書き込みたいオブジェクトを指定します。

@raise IOError 自身が書き込み用にオープンされていなければ発生します。

//emlist[例][ruby]{
require "stringio"
a = StringIO.new("", 'r+')
a.printf("%c%c%c", 97, 98, 99)
a.string ...

Symbol#intern -> self (36604.0)

self を返します。

self を返します。

例:

:foo.intern # => :foo

@see String#intern

Thread#pending_interrupt?(error = nil) -> bool (36604.0)

self の非同期例外のキューが空かどうかを返します。

self の非同期例外のキューが空かどうかを返します。

@param error 対象の例外クラスを指定します。


@see Thread.pending_interrupt?

WIN32OLE#ole_query_interface(iid) -> WIN32OLE (36604.0)

IID(インターフェイスID)を指定してオブジェクトの別のインターフェイスを 持つオブジェクトを取得します。

IID(インターフェイスID)を指定してオブジェクトの別のインターフェイスを
持つオブジェクトを取得します。

オブジェクトが複数のオートメーション用インターフェイスを持つ場合に、当
メソッドを利用して既定のインターフェイスとは異なるインターフェイスを取
得します。

@param iid 取得するインターフェイスのIIDを文字列で指定します。
@return iidパラメータで指定したインターフェイスを持つWIN32OLEオブジェクト
@raise WIN32OLERuntimeError 指定したIIDをオブジェクトが持たない場合に通知されます。

ie = WIN32OLE.n...

絞り込み条件を変える

Zlib::GzipWriter#print(*str) -> nil (36604.0)

引数を自身に順に出力します。引数を省略した場合は、$_ を出力します。

引数を自身に順に出力します。引数を省略した場合は、$_ を出力します。

@param str 出力するオブジェクトを指定します。

require 'zlib'

filename='hoge1.gz'
fw = File.open(filename, "w")
Zlib::GzipWriter.wrap(fw, Zlib::BEST_COMPRESSION){|gz|
gz.print "ugo"
}
fr = File.open(filename)
Zlib::GzipReader.wrap(fr){|gz|
puts gz.read
}...

Zlib::Inflate#sync_point? -> bool (36604.0)

@todo zlib.h にもドキュメントが無い?

@todo zlib.h にもドキュメントが無い?

What is this?

Integer#downto(min) -> Enumerator (36307.0)

self から min まで 1 ずつ減らしながらブロックを繰り返し実行します。 self < min であれば何もしません。

self から min まで 1 ずつ減らしながらブロックを繰り返し実行します。
self < min であれば何もしません。

@param min 数値
@return self を返します。

//emlist[][ruby]{
5.downto(1) {|i| print i, " " } # => 5 4 3 2 1
//}

@see Integer#upto, Numeric#step, Integer#times

Integer#downto(min) {|n| ... } -> self (36307.0)

self から min まで 1 ずつ減らしながらブロックを繰り返し実行します。 self < min であれば何もしません。

self から min まで 1 ずつ減らしながらブロックを繰り返し実行します。
self < min であれば何もしません。

@param min 数値
@return self を返します。

//emlist[][ruby]{
5.downto(1) {|i| print i, " " } # => 5 4 3 2 1
//}

@see Integer#upto, Numeric#step, Integer#times

TracePoint#event -> Symbol (36304.0)

発生したイベントの種類を Symbol で返します。

発生したイベントの種類を Symbol で返します。

発生するイベントの詳細については、TracePoint.new を参照してくださ
い。

@raise RuntimeError イベントフックの外側で実行した場合に発生します。

//emlist[例][ruby]{
def foo(ret)
ret
end
trace = TracePoint.new(:call, :return) do |tp|
p tp.event
end
trace.enable
foo 1
# => :call
# :return
//}

絞り込み条件を変える

StringIO#set_encoding(ext_enc, int_enc) -> self (28228.0)

自身のエンコーディングを指定されたエンコーディングに設定します。

自身のエンコーディングを指定されたエンコーディングに設定します。

@param ext_enc エンコーディングを指定します。
nil を指定した場合は Encoding.default_external が
使われます。

@param int_enc 無視されます。IO クラスの API との互換性のために用
意されています。

@param opt 無視されます。IO クラスの API との互換性のために用意さ
れています。

StringIO#set_encoding(ext_enc, int_enc, opt) -> self (28228.0)

自身のエンコーディングを指定されたエンコーディングに設定します。

自身のエンコーディングを指定されたエンコーディングに設定します。

@param ext_enc エンコーディングを指定します。
nil を指定した場合は Encoding.default_external が
使われます。

@param int_enc 無視されます。IO クラスの API との互換性のために用
意されています。

@param opt 無視されます。IO クラスの API との互換性のために用意さ
れています。

OpenSSL::BN#to_int -> Integer (28207.0)

自身を Integer のインスタンスに変換します。

自身を Integer のインスタンスに変換します。

@raise OpenSSL::BNError 変換に失敗した場合に発生します

CGI::QueryExtension#content_length -> Integer (28204.0)

ENV['CONTENT_LENGTH'] を返します。

ENV['CONTENT_LENGTH'] を返します。

Net::HTTPHeader#content_length -> Integer|nil (28204.0)

Content-Length: ヘッダフィールドの表している値を整数で返します。

Content-Length: ヘッダフィールドの表している値を整数で返します。

ヘッダが設定されていない場合には nil を返します。

@raise Net::HTTPHeaderSyntaxError フィールドの値が不正である場合に
発生します。

//emlist[例][ruby]{
require 'net/http'

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
re...

絞り込み条件を変える

<< 1 2 3 ... > >>