るりまサーチ (Ruby 2.6.0)

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

別のキーワード

  1. _builtin each_object
  2. objectspace each_object
  3. object send
  4. object to_enum
  5. object enum_for

検索結果

Object#then {|x| ... } -> object (117649.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 -> Enumerator (117349.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 (72349.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 -> Enumerator (72049.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).
...

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

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

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

絞り込み条件を変える

Prime#each(upper_bound = nil, generator = EratosthenesGenerator.new) {|prime| ... } -> object (604.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 (604.0)

Prime.instance.each と同じです。

Prime.instance.each と同じです。

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

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

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


@see Prime#each

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

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

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

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

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

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

Timeout.#timeout(sec, exception_class = nil) {|i| ... } -> object (325.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 (325.0)

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

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

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

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

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

絞り込み条件を変える

Prime#each(upper_bound = nil, generator = EratosthenesGenerator.new) -> Enumerator (304.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 (304.0)

Prime.instance.each と同じです。

Prime.instance.each と同じです。

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

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

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


@see Prime#each

クラス/メソッドの定義 (235.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 (163.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
* 文字列の式展...

NEWS for Ruby 2.6.0 (145.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...

絞り込み条件を変える

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

Rubyで使われる記号の意味(正規表現の複雑な記号は除く) (91.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を参...

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

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

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

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

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

coverage (55.0)

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

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

=== 基本的な使い方

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

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

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

==== 簡単な例

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

絞り込み条件を変える