るりまサーチ (Ruby 2.6.0)

最速Rubyリファレンスマニュアル検索!
72件ヒット [1-72件を表示] (0.025秒)
トップページ > クエリ:then[x] > バージョン:2.6.0[x]

別のキーワード

  1. object then
  2. _builtin then
  3. then object
  4. then _builtin

検索結果

Object#then -> Enumerator (54325.0)

self を引数としてブロックを評価し、ブロックの結果を返します。

self を引数としてブロックを評価し、ブロックの結果を返します。

//emlist[例][ruby]{
3.next.then {|x| x**x }.to_s # => "256"
"my string".yield_self {|s| s.upcase } # => "MY STRING"
//}

値をメソッドチェインのパイプラインに次々と渡すのは良い使い方です。

//emlist[メソッドチェインのパイプライン][ruby]{
require 'open-uri'
require 'json'

construct_url(arguments).
...

Object#then {|x| ... } -> object (54325.0)

self を引数としてブロックを評価し、ブロックの結果を返します。

self を引数としてブロックを評価し、ブロックの結果を返します。

//emlist[例][ruby]{
3.next.then {|x| x**x }.to_s # => "256"
"my string".yield_self {|s| s.upcase } # => "MY STRING"
//}

値をメソッドチェインのパイプラインに次々と渡すのは良い使い方です。

//emlist[メソッドチェインのパイプライン][ruby]{
require 'open-uri'
require 'json'

construct_url(arguments).
...

Net::IMAP.add_authenticator(auth_type, authenticator) -> () (18601.0)

Net::IMAP#authenticate で使う 認証用クラスを設定します。

Net::IMAP#authenticate で使う
認証用クラスを設定します。

imap ライブラリに新たな認証方式を追加するために用います。

通常は使う必要はないでしょう。もしこれを用いて
認証方式を追加する場合は net/imap.rb の
Net::IMAP::LoginAuthenticator などを参考にしてください。

@param auth_type 認証の種類(文字列)
@param authenticator 認証クラス(Class オブジェクト)

Net::IMAP#authenticate(auth_type, user, password) -> Net::IMAP::TaggedResponse (18301.0)

AUTHENTICATE コマンドを送り、クライアントを認証します。

AUTHENTICATE コマンドを送り、クライアントを認証します。

auth_type で利用する認証方式を文字列で指定します。


例:
imap.authenticate('LOGIN', user, password)

auth_type としては以下がサポートされています。
* "LOGIN"
* "PLAIN"
* "CRAM-MD5"
* "DIGEST-MD5"

@param auth_type 認証方式を表す文字列
@param user ユーザ名文字列
@param password パスワード文字列
@see Net::IMAP#login

Net::SMTP#authenticate(user, secret, authtype) -> () (18301.0)

認証を行います。

認証を行います。

このメソッドはセッション開始(Net::SMTP#start)後、
メールを送る前に呼びだしてください。

通常は Net::SMTP.start や Net::SMTP#start で認証を
行うためこれを利用する必要はないはずです。

@param user 認証で使うアカウント名
@param secret 認証で使うパスワード
@param authtype 認証の種類(:plain, :login, :cram_md5 のいずれか)

@see Net::SMTP.start, Net::SMTP#start, Net::SMTP#auth_plain, Net:...

絞り込み条件を変える

Socket::Constants::SO_SECURITY_AUTHENTICATION -> Integer (18301.0)

@todo

@todo

Socket::SO_SECURITY_AUTHENTICATION -> Integer (18301.0)

@todo

@todo

WEBrick::HTTPAuth::BasicAuth#authenticate(request, response) -> bool (18301.0)

クライアントから送られてきたユーザ名とパスワードを認証します。 認証に失敗した場合は challenge を呼びます。

クライアントから送られてきたユーザ名とパスワードを認証します。
認証に失敗した場合は challenge を呼びます。

@param request WEBrick::HTTPRequest のインスタンスを指定します。

@param response WEBrick::HTTPResponse のインスタンスを指定します。

@raise WEBrick::HTTPStatus::Unauthorized 認証に失敗した場合に発生します。

WEBrick::HTTPAuth::DigestAuth#authenticate(request, response) -> true (18301.0)

クライアントから送られてきたユーザ名とパスワードを認証します。 認証に失敗した場合は challenge を呼びます。

クライアントから送られてきたユーザ名とパスワードを認証します。
認証に失敗した場合は challenge を呼びます。

@param request WEBrick::HTTPRequest のインスタンスを指定します。

@param response WEBrick::HTTPResponse のインスタンスを指定します。

@raise WEBrick::HTTPStatus::Unauthorized 認証に失敗した場合に発生します。

Net::HTTPNetworkAuthenticationRequired (18001.0)

HTTP レスポンス 511 (Network Authentication Required) を表現するクラスです。

HTTP レスポンス 511 (Network Authentication Required) を表現するクラスです。

詳しくは 6585 を見てください。

絞り込み条件を変える

Net::HTTPProxyAuthenticationRequired (18001.0)

HTTP レスポンス 407 (Proxy Authentication Required) を表現するクラスです。

HTTP レスポンス 407 (Proxy Authentication Required) を表現するクラスです。

詳しくは 7235 Section 3.2 を見てください。

Net::POPAuthenticationError (18001.0)

POP3 で認証に失敗したときに発生します。

POP3 で認証に失敗したときに発生します。

Net::SMTPAuthenticationError (18001.0)

SMTP 認証エラー(エラーコード 530)に対応する例外クラスです。

SMTP 認証エラー(エラーコード 530)に対応する例外クラスです。

Prime::EratosthenesGenerator (18001.0)

Prime::PseudoPrimeGenerator の具象クラスです。 素数の生成にエラトステネスのふるいを使用しています。

Prime::PseudoPrimeGenerator の具象クラスです。
素数の生成にエラトステネスのふるいを使用しています。

WEBrick::HTTPAuth::Authenticator (18001.0)

絞り込み条件を変える

WEBrick::HTTPAuth::ProxyAuthenticator (18001.0)

このモジュールはプロキシのためにダイジェスト認証とベーシック認証の両方 の一般的なサポートを提供します。

このモジュールはプロキシのためにダイジェスト認証とベーシック認証の両方
の一般的なサポートを提供します。

WEBrick::HTTPStatus::ProxyAuthenticationRequired (18001.0)

HTTP のステータスコード 407 Proxy Authentication Required を表すクラスです。

HTTP のステータスコード 407 Proxy Authentication Required を表すクラスです。

webrick/httpauth/authenticator (18001.0)

HTTP 認証で利用するモジュールを提供するライブラリです。

HTTP 認証で利用するモジュールを提供するライブラリです。

WEBrick::HTTPAuth::ProxyAuthenticator::InfoField -> "Proxy-Authentication-Info" (9301.0)

キーの名前です。

キーの名前です。

WEBrick::HTTPAuth::ProxyAuthenticator::ResponseField -> "Proxy-Authenticate" (9301.0)

レスポンスフィールドのキーの名前です。

レスポンスフィールドのキーの名前です。

絞り込み条件を変える

WEBrick::HTTPStatus::RC_PROXY_AUTHENTICATION_REQUIRED (9301.0)

HTTP のステータスコードを表す整数です。

HTTP のステータスコードを表す整数です。

require 'webrick'
p WEBrick::HTTPStatus::RC_INTERNAL_SERVER_ERROR #=> 500

Object#yield_self -> Enumerator (9025.0)

self を引数としてブロックを評価し、ブロックの結果を返します。

self を引数としてブロックを評価し、ブロックの結果を返します。

//emlist[例][ruby]{
3.next.then {|x| x**x }.to_s # => "256"
"my string".yield_self {|s| s.upcase } # => "MY STRING"
//}

値をメソッドチェインのパイプラインに次々と渡すのは良い使い方です。

//emlist[メソッドチェインのパイプライン][ruby]{
require 'open-uri'
require 'json'

construct_url(arguments).
...

Object#yield_self {|x| ... } -> object (9025.0)

self を引数としてブロックを評価し、ブロックの結果を返します。

self を引数としてブロックを評価し、ブロックの結果を返します。

//emlist[例][ruby]{
3.next.then {|x| x**x }.to_s # => "256"
"my string".yield_self {|s| s.upcase } # => "MY STRING"
//}

値をメソッドチェインのパイプラインに次々と渡すのは良い使い方です。

//emlist[メソッドチェインのパイプライン][ruby]{
require 'open-uri'
require 'json'

construct_url(arguments).
...

Prime::EratosthenesGenerator#next -> Integer (9001.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
//}

Prime::EratosthenesGenerator#rewind -> nil (9001.0)

列挙状態を巻き戻します。

列挙状態を巻き戻します。

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

generator.rewind

p generator.next #=> 2
//}

絞り込み条件を変える

Prime::EratosthenesGenerator#succ -> Integer (9001.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
//}

WEBrick::HTTPAuth::Authenticator#logger -> object (9001.0)

ロガーオブジェクトを返します。

ロガーオブジェクトを返します。

WEBrick::HTTPAuth::Authenticator#realm -> String (9001.0)

レルムを返します。

レルムを返します。

WEBrick::HTTPAuth::Authenticator#userdb -> WEBrick::HTTPAuth::Htpasswd | WEBrick::HTTPAuth::Htdigest (9001.0)

認証のためのユーザデータベースを返します。

認証のためのユーザデータベースを返します。

@see WEBrick::HTTPAuth::BasicAuth, WEBrick::HTTPAuth::Htdigest

WEBrick::HTTPAuth::Authenticator::AuthException -> Class (9001.0)

認証失敗時に発生する例外のクラスです。

認証失敗時に発生する例外のクラスです。

絞り込み条件を変える

WEBrick::HTTPAuth::Authenticator::AuthScheme -> nil (9001.0)

認証方法を表わします。派生クラスで上書きしなければなりません。

認証方法を表わします。派生クラスで上書きしなければなりません。

WEBrick::HTTPAuth::Authenticator::RequestField -> String (9001.0)

リクエストフィールドのキーの名前です。

リクエストフィールドのキーの名前です。

WEBrick::HTTPAuth::Authenticator::ResponseField -> String (9001.0)

レスポンスフィールドのキーの名前です。

レスポンスフィールドのキーの名前です。

WEBrick::HTTPAuth::Authenticator::ResponseInfoField -> String (9001.0)

レスポンスインフォフィールドのキーの名前です。

レスポンスインフォフィールドのキーの名前です。

WEBrick::HTTPAuth::ProxyAuthenticator::AuthException -> Class (9001.0)

WEBrick::HTTPStatus::ProxyAuthenticationRequired です。

WEBrick::HTTPStatus::ProxyAuthenticationRequired です。

絞り込み条件を変える

WEBrick::HTTPAuth::ProxyAuthenticator::RequestField -> "Proxy-Authorization" (9001.0)

リクエストフィールドのキーの名前です。

リクエストフィールドのキーの名前です。

Prime#each(upper_bound = nil, generator = EratosthenesGenerator.new) -> Enumerator (301.0)

全ての素数を順番に与えられたブロックに渡して評価します。

全ての素数を順番に与えられたブロックに渡して評価します。

@param upper_bound 任意の正の整数を指定します。列挙の上界です。
nil が与えられた場合は無限に列挙し続けます。

@param generator 素数生成器のインスタンスを指定します。

@return ブロックの最後に評価された値を返します。
ブロックが与えられなかった場合は、Enumerator と互換性のある外部イテレータを返します。

//emlist[例][ruby]{
require 'prime'
Prime.each(6){|prime| ...

Prime#each(upper_bound = nil, generator = EratosthenesGenerator.new) {|prime| ... } -> object (301.0)

全ての素数を順番に与えられたブロックに渡して評価します。

全ての素数を順番に与えられたブロックに渡して評価します。

@param upper_bound 任意の正の整数を指定します。列挙の上界です。
nil が与えられた場合は無限に列挙し続けます。

@param generator 素数生成器のインスタンスを指定します。

@return ブロックの最後に評価された値を返します。
ブロックが与えられなかった場合は、Enumerator と互換性のある外部イテレータを返します。

//emlist[例][ruby]{
require 'prime'
Prime.each(6){|prime| ...

Prime.each(upper_bound = nil, generator = EratosthenesGenerator.new) -> Enumerator (301.0)

Prime.instance.each と同じです。

Prime.instance.each と同じです。

@param upper_bound 任意の正の整数を指定します。列挙の上界です。
nil が与えられた場合は無限に列挙し続けます。

@param generator 素数生成器のインスタンスを指定します。

@return ブロックの最後に評価された値を返します。
ブロックが与えられなかった場合は、Enumerator と互換性のある外部イテレータを返します。


@see Prime#each

Prime.each(upper_bound = nil, generator = EratosthenesGenerator.new) {|prime| ... } -> object (301.0)

Prime.instance.each と同じです。

Prime.instance.each と同じです。

@param upper_bound 任意の正の整数を指定します。列挙の上界です。
nil が与えられた場合は無限に列挙し続けます。

@param generator 素数生成器のインスタンスを指定します。

@return ブロックの最後に評価された値を返します。
ブロックが与えられなかった場合は、Enumerator と互換性のある外部イテレータを返します。


@see Prime#each

絞り込み条件を変える

制御構造 (235.0)

制御構造 条件分岐: * if * unless * case 繰り返し: * while * until * for * break * next * redo * retry 例外処理: * raise * begin その他: * return * BEGIN * END

制御構造
条件分岐:
* if
* unless
* case
繰り返し:
* while
* until
* for
* break
* next
* redo
* retry
例外処理:
* raise
* begin
その他:
* return
* BEGIN
* END

Rubyでは(Cなどとは異なり)制御構造は式であって、何らかの値を返すものが
あります(返さないものもあります。値を返さない式を代入式の右辺に置くと
syntax error になります)。

R...

クラス/メソッドの定義 (109.0)

クラス/メソッドの定義 * クラス/メソッドの定義: * class * singleton_class * module * method * operator * nest_method * eval_method * singleton_method * class_method * limit * 定義に関する操作: * alias * undef * defined

クラス/メソッドの定義
* クラス/メソッドの定義:
* class
* singleton_class
* module
* method
* operator
* nest_method
* eval_method
* singleton_method
* class_method
* limit
* 定義に関する操作:
* alias
* undef
* defined

===[a:class] クラス定義

//emlist[例][ruby]{
class Foo < S...

NEWS for Ruby 2.5.0 (73.0)

NEWS for Ruby 2.5.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

NEWS for Ruby 2.5.0
このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

それぞれのエントリーは参照情報があるため短いです。
十分な情報と共に書かれた全ての変更のリストは ChangeLog ファイルか bugs.ruby-lang.org の issue を参照してください。

== 2.4.0 以降の変更

=== 言語仕様の変更

* トップレベルの定数参照を削除しました 11547
* do/end ブロック内部で rescue/else/ensure を書けるようになりました 12906
* 文字列の式展...

Proc#===(*arg) -> () (73.0)

手続きオブジェクトを実行してその結果を返します。

手続きオブジェクトを実行してその結果を返します。

引数の渡され方はオブジェクトの生成方法によって異なります。
詳しくは Proc#lambda? を参照してください。

「===」は when の所に手続きを渡せるようにするためのものです。

//emlist[例][ruby]{
def sign(n)
case n
when lambda{|n| n > 0} then 1
when lambda{|n| n < 0} then -1
else 0
end
end

p sign(-4) #=> -1
p sign(0) #=> 0
p sign(7) #=> 1...

Proc#[](*arg) -> () (73.0)

手続きオブジェクトを実行してその結果を返します。

手続きオブジェクトを実行してその結果を返します。

引数の渡され方はオブジェクトの生成方法によって異なります。
詳しくは Proc#lambda? を参照してください。

「===」は when の所に手続きを渡せるようにするためのものです。

//emlist[例][ruby]{
def sign(n)
case n
when lambda{|n| n > 0} then 1
when lambda{|n| n < 0} then -1
else 0
end
end

p sign(-4) #=> -1
p sign(0) #=> 0
p sign(7) #=> 1...

絞り込み条件を変える

Proc#call(*arg) -> () (73.0)

手続きオブジェクトを実行してその結果を返します。

手続きオブジェクトを実行してその結果を返します。

引数の渡され方はオブジェクトの生成方法によって異なります。
詳しくは Proc#lambda? を参照してください。

「===」は when の所に手続きを渡せるようにするためのものです。

//emlist[例][ruby]{
def sign(n)
case n
when lambda{|n| n > 0} then 1
when lambda{|n| n < 0} then -1
else 0
end
end

p sign(-4) #=> -1
p sign(0) #=> 0
p sign(7) #=> 1...

Proc#yield(*arg) -> () (73.0)

手続きオブジェクトを実行してその結果を返します。

手続きオブジェクトを実行してその結果を返します。

引数の渡され方はオブジェクトの生成方法によって異なります。
詳しくは Proc#lambda? を参照してください。

「===」は when の所に手続きを渡せるようにするためのものです。

//emlist[例][ruby]{
def sign(n)
case n
when lambda{|n| n > 0} then 1
when lambda{|n| n < 0} then -1
else 0
end
end

p sign(-4) #=> -1
p sign(0) #=> 0
p sign(7) #=> 1...

Time.strptime(date, format, now=self.now) -> Time (73.0)

文字列を Date._strptime を用いて Time オブジェクト に変換します。

文字列を Date._strptime を用いて Time オブジェクト
に変換します。

require 'time'
Time.strptime('2001-02-03T04:05:06+09:00', '%Y-%m-%dT%H:%M:%S%z')
#=> 2001-02-03 06:05:06 +0900

ブロックを渡すと年の部分をブロックによって変換できます。
require 'time'
Time.strptime('91/5/18 4:13:00', '%Y/%m/%d %T'){|y|
if y > 100 then y
elsif y >...

Time.strptime(date, format, now=self.now) {|y| ... } -> Time (73.0)

文字列を Date._strptime を用いて Time オブジェクト に変換します。

文字列を Date._strptime を用いて Time オブジェクト
に変換します。

require 'time'
Time.strptime('2001-02-03T04:05:06+09:00', '%Y-%m-%dT%H:%M:%S%z')
#=> 2001-02-03 06:05:06 +0900

ブロックを渡すと年の部分をブロックによって変換できます。
require 'time'
Time.strptime('91/5/18 4:13:00', '%Y/%m/%d %T'){|y|
if y > 100 then y
elsif y >...

Range#===(obj) -> bool (55.0)

始端と終端の中に obj があるとき、true を返します。 そうでないとき、false を返します。

始端と終端の中に obj があるとき、true を返します。
そうでないとき、false を返します。

Range#=== は主に case 式での比較に用いられます。

//emlist[例][ruby]{
p (0...50) === 79 #=> false
p (60...80) === 79 #=> true

case 79
when 0...60 then puts "low"
when 60...80 then puts "medium" # => medium
when 80..100 then puts "high"
end
//}

2.5 以前は、単...

絞り込み条件を変える

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

RDoc::Context#find_symbol(symbol, method=nil) (49.0)

Look up the given symbol. If method is non-nil, then we assume the symbol references a module that contains that method

Look up the given symbol. If method is non-nil, then we assume
the symbol references a module that contains that method

絞り込み条件を変える

Gem::DependencyList#dependency_order -> [Gem::Specification] (37.0)

依存する Gem の数が少ない順にソートされた Gem::Specification のリストを返します。

依存する Gem の数が少ない順にソートされた Gem::Specification のリストを返します。

このことは、インストール済みの Gem を削除するときに便利です。
このメソッドで返された順にインストール済みの Gem 削除すると、
依存関係による多くの問題を回避することができます。

If there are circular dependencies (yuck!), then gems will be
returned in order until only the circular dependents and anything
they reference are le...

Rake::FileList#exclude(*patterns) {|entry| ... } -> self (37.0)

自身から取り除くべきファイル名のパターンを自身の除外リストに登録します。

自身から取り除くべきファイル名のパターンを自身の除外リストに登録します。

パターンとして正規表現、グロブパターン、文字列が使用可能です。
さらにブロックが与えられた場合は、ブロックを評価して真になったエントリを削除します。

グロブパターンはファイルシステムに対して展開されます。
もし、ファイルシステムに存在しないファイルを明示的にリストへ追加した場合、
グロブパターンではそのファイルをリストから削除しません。

例:
FileList['a.c', 'b.c'].exclude("a.c") # => ['b.c']
FileList['a.c', 'b.c'].exclude(...

Rubyで使われる記号の意味(正規表現の複雑な記号は除く) (37.0)

Rubyで使われる記号の意味(正規表現の複雑な記号は除く) ex q num per and or  plus minus ast slash hat sq  period comma langl rangl eq tilde  dollar at under lbrarbra  lbra2rbra2 lbra3rbra3 dq colon ac  backslash semicolon

Rubyで使われる記号の意味(正規表現の複雑な記号は除く)
ex q num per and or 
plus minus ast slash hat sq 
period comma langl rangl eq tilde 
dollar at under lbrarbra 
lbra2rbra2 lbra3rbra3 dq colon ac 
backslash semicolon

===[a:ex] !

: !true

not 演算子。d:spec/operator#notを参照。

: 3 != 5

「等しくない」比較演算子。d:spec/operator#notを参...

WIN32OLE::ARGV -> [object] (37.0)

直前のメソッド呼び出しの引数を格納した配列です。

直前のメソッド呼び出しの引数を格納した配列です。

OLEオートメーションでは呼び出し先が引数に対して値を設定できます。しかし、
Rubyのメソッド引数は値のみを取るため、そのままでは呼び出し先が設定した
値を参照できません。このような場合、ARGVを参照することで呼び出し先の設
定値を参照できます。

以下のリストは、VBで開発したオブジェクトのメソッド呼び出しを例としてい
ます。このメソッド(Accm)は、第1引数で指定した演算を第2引数と第3引数に
適用し、結果を第2引数に設定します。

' VB (OLE Automation server)
Public Sub Accm(...

coverage (37.0)

カバレッジを測定するためのライブラリです。

カバレッジを測定するためのライブラリです。

=== 基本的な使い方

以下のようにして測定を行います。

(1) require "coverage" で、ライブラリを読み込む。
(2) Coverage.start を実行し、測定を開始する。
(3) require や load で測定対象のファイルを実行する。
(4) Coverage.result や Coverage.peek_result で結果を確認する。

Coverage.result は、ファイル名をキーとし、カバレッジ測定結果を値とするハッシュを返します。

==== 簡単な例

まず測定対象のソースを用...

絞り込み条件を変える

getoptlong (37.0)

getoptlong は、GNU の getopt_long() とまったく同じ方式でコマンド 行オプションの解析を行う Ruby のライブラリです。

getoptlong は、GNU の getopt_long() とまったく同じ方式でコマンド
行オプションの解析を行う Ruby のライブラリです。


=== GNU getopt_long() とは?

GNU getopt_long() は、コマンド行オプションの解析を行う C の関数です。多
くの GNU ソフトウェアがこの関数を使用しています。GNU getopt_long() そし
て getoptlong には、以下のような特徴があります。

* 伝統的な一文字オプションに加えて、長いオプションに対応しています。長
いオプションは `-' の代わりに `--' で始まり...

CGI::HtmlExtension#html(attributes = {}) -> String (19.0)

トップレベルの html 要素を生成します。 ブロックを与えると、ブロックを評価した結果が内容になります。

トップレベルの html 要素を生成します。
ブロックを与えると、ブロックを評価した結果が内容になります。

@param attributes 属性をハッシュで指定します。
擬似属性の "PRETTY" に文字列を与えるとその文字列でインデントした HTML を生成します。
擬似属性の "DOCTYPE" には DOCTYPE 宣言として使用する文字列を与えることができます。

例:

html{ "string" }
# <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2...

CGI::HtmlExtension#html(attributes = {}) { ... } -> String (19.0)

トップレベルの html 要素を生成します。 ブロックを与えると、ブロックを評価した結果が内容になります。

トップレベルの html 要素を生成します。
ブロックを与えると、ブロックを評価した結果が内容になります。

@param attributes 属性をハッシュで指定します。
擬似属性の "PRETTY" に文字列を与えるとその文字列でインデントした HTML を生成します。
擬似属性の "DOCTYPE" には DOCTYPE 宣言として使用する文字列を与えることができます。

例:

html{ "string" }
# <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2...

Coverage.start(option = {}) -> nil (19.0)

カバレッジの測定を開始します。既に実行されていた場合には何も起こりません。 ただし、カバレッジ計測中に測定対象を変更しようとした場合は、RuntimeError となります。

カバレッジの測定を開始します。既に実行されていた場合には何も起こりません。
ただし、カバレッジ計測中に測定対象を変更しようとした場合は、RuntimeError となります。

@param option カバレッジの計測モードを指定します。
:all か "all" を指定すると、全ての種類を計測します。
個別に指定する場合は、ハッシュを渡します。
詳細は、coverage ライブラリ を参照してください。

//emlist[bool.rb][ruby]{
def bool(obj)
if obj
...

NEWS for Ruby 2.6.0 (19.0)

NEWS for Ruby 2.6.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...NEWS for Ruby 2.6.0
このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

それぞれのエントリーは参照情報があるため短いです。
十分な情報と共に書かれた全ての変更のリス...
...ます。
Object#to_d メソッドは Kernel.#BigDecimal() や
BigDecimal.new とは違いがあります。
* 2.0.0 は Ruby 2.6.0 のリリース後すぐにリリースされる予定です。
このバージョンは BigDecimal.new メソッドを含みません。...
...をリビルドする必要がある負担がなくなります。
* 変更前:
* libruby.2.6.0.dylib
* libruby.2.6.dylib -> libruby.2.6.0.dylib
* libruby.dylib -> libruby.2.6.0.dylib
* 変更後:
* libruby.2.6.dylib
* libruby.dylib -> libruby.2.6.dylib

* mi...

絞り込み条件を変える

Numeric (19.0)

数値を表す抽象クラスです。Integer や Float などの数値クラス は Numeric のサブクラスとして実装されています。

数値を表す抽象クラスです。Integer や Float などの数値クラス
は Numeric のサブクラスとして実装されています。

演算や比較を行うメソッド(+, -, *, /, <=>)は Numeric のサブクラスで定義されま
す。Numeric で定義されているメソッドは、サブクラスで提供されているメソッド
(+, -, *, /, %) を利用して定義されるものがほとんどです。
つまり Numeric で定義されているメソッドは、Numeric のサブクラスとして新たに数値クラスを定義した時に、
演算メソッド(+, -, *, /, %, <=>, coerce)だけを定義すれ...

TCPSocket (19.0)

インターネットドメインのストリーム型ソケットのクラスです。

インターネットドメインのストリーム型ソケットのクラスです。

通常のIO クラスのサブクラスと同
様の入出力ができます。このクラスによってソケットを用いたクラ
イアントを簡単に記述できるようになります。

ユーザの入力をそのままサーバに転送するプログラムは以下の
ようになります。

require "socket"

port = if ARGV.size > 0 then ARGV.shift else 4444 end
print port, "\n"

s = TCPSocket.open("localhost", port)

while gets
...

Timeout.#timeout(sec, exception_class = nil) {|i| ... } -> object (19.0)

ブロックを sec 秒の期限付きで実行します。 ブロックの実行時間が制限を過ぎたときは例外 Timeout::Error が発生します。

ブロックを sec 秒の期限付きで実行します。
ブロックの実行時間が制限を過ぎたときは例外
Timeout::Error が発生します。

exception_class を指定した場合には Timeout::Error の代わりに
その例外が発生します。
ブロックパラメータ i は sec がはいります。

また sec が 0 もしくは nil のときは制限時間なしで
ブロックを実行します。

@param sec タイムアウトする時間を秒数で指定します.
@param exception_class タイムアウトした時、発生させる例外を指定します.
@param message エラー...

Timeout.#timeout(sec, exception_class, message) {|i| ... } -> object (19.0)

ブロックを sec 秒の期限付きで実行します。 ブロックの実行時間が制限を過ぎたときは例外 Timeout::Error が発生します。

ブロックを sec 秒の期限付きで実行します。
ブロックの実行時間が制限を過ぎたときは例外
Timeout::Error が発生します。

exception_class を指定した場合には Timeout::Error の代わりに
その例外が発生します。
ブロックパラメータ i は sec がはいります。

また sec が 0 もしくは nil のときは制限時間なしで
ブロックを実行します。

@param sec タイムアウトする時間を秒数で指定します.
@param exception_class タイムアウトした時、発生させる例外を指定します.
@param message エラー...

プログラム・文・式 (19.0)

プログラム・文・式 * exp * terminate

プログラム・文・式
* exp
* terminate

プログラムはexpを並べたものです。式と式の間はセミコロ
ン(;)または改行で区切ります。ただし、バックスラッシュに続く改行は文
の区切りにならず、次の行へ継続します。

例:

print "hello world!\n"


===[a:exp] 式

例:

true
(1+2)*3
foo()
if test then ok else ng end

Ruby の式には、spec/variables、さまざまなspec/literal...

絞り込み条件を変える

字句構造 (19.0)

字句構造 * identifier * comment * embed * reserved

字句構造
* identifier
* comment
* embed
* reserved

Rubyの現在の実装はASCIIキャラクタセットを用いています。アル
ファベットの大文字と小文字は区別されます。識別子と一部のリテ
ラルの途中を除いては任意の場所に空白文字やコメントを置くこと
ができます。空白文字とはスペース、タブ、垂直タブ、バックスペー
ス、キャリッジリターン、ラインフィード、改ページです。改行は行が明らかに次の
行に継続する時だけ、空白文字として、それ以外では文の区切りと
して解釈されます。

改行と認識されるのは、キャリッジリターン+ラインフィードかラインフ...

演算子式 (19.0)

演算子式 * assign * selfassign * multiassign * range * range_cond * and * or * not * cond

...る舞います。
フリップフロップ (flip-flop) とも呼ばれます。

この振る舞いは 2.6.0 で deprecated になりましたが、元に戻りました。
そのため、2.6.0 から 2.6.3 では使うと「warning: flip-flop is deprecated」という警告がでます。

「.....