るりまサーチ

最速Rubyリファレンスマニュアル検索!
49件ヒット [1-49件を表示] (0.081秒)
トップページ > クエリ:l[x] > クエリ:pass[x] > ライブラリ:ビルトイン[x]

別のキーワード

  1. matrix l
  2. kernel $-l
  3. _builtin $-l
  4. lupdecomposition l
  5. l

クラス

キーワード

検索結果

Thread.pass -> nil (18215.0)

他のスレッドに実行権を譲ります。実行中のスレッドの状態を変えずに、 他の実行可能状態のスレッドに制御を移します。

...権を譲ります。実行中のスレッドの状態を変えずに、
他の実行可能状態のスレッドに制御を移します。

Thread.new do
(1..3).each{|i|
p i
Thread.pass
}
exit
end

l
oop do
Thread.pass
p :main
end

#=>
1
:main
2
:main
3
:main...

Object#initialize(*args, &block) -> object (6126.0)

ユーザ定義クラスのオブジェクト初期化メソッド。

...

このメソッドは Class#new から新しく生成されたオブ
ジェクトの初期化のために呼び出されます。他の言語のコンストラクタに相当します。
デフォルトの動作ではなにもしません。

initialize には
Class#new に与えられた引数...
...initialize という名前のメソッドは自動的に private に設定され
ます。

@param args 初期化時の引数です。
@param block 初期化時のブロック引数です。必須ではありません。

//emlist[][ruby]{
class Foo
def initialize name
puts "initialize Foo"...
...@name = name
end
end

class Bar < Foo
def initialize name, pass
puts "initialize Bar"
super name
@pass = pass
end
end

it = Bar.new('myname','0500')
p it
#=> initialize Bar
# initialize Foo
# #<Bar:0x2b68f08 @name="myname", @pass="0500">
//}

@see Class#new...

Thread.handle_interrupt(hash) { ... } -> object (6108.0)

スレッドの割り込みのタイミングを引数で指定した内容に変更してブロックを 実行します。

...Thread#kill、Signal.#trap(未サポート)、メインスレッドの終了
(メインスレッドが終了すると、他のスレッドも終了されます)を意味します。

@param hash 例外クラスがキー、割り込みのタイミングを指定する
Symbol が値の Ha...
...sh を指定します。
値の内容は以下のいずれかです。

: :immediate

すぐに割り込みます。

: :on_blocking

ブロッキング処理(後述)の間は割り込みが発生します。

: :never

まったく割り込みません。

「ブロッキング処...
...理や書き込み処理のような呼び出し元
のスレッドをブロックするような処理を意味します。CRuby の実装では、GVL
を解放して実行する処理は全てブロッキング処理に含まれます。

また、マスクされた非同期割り込みは再度...

Module#ruby2_keywords(method_name, ...) -> nil (3108.0)

For the given method names, marks the method as passing keywords through a normal argument splat. This should only be called on methods that accept an argument splat (`*args`) but not explicit keywords or a keyword splat. It marks the method such that if the method is called with keyword arguments, the final hash argument is marked with a special flag such that if it is the final element of a normal argument splat to another method call, and that method call does not include explicit keywords or a keyword splat, the final element is interpreted as keywords. In other words, keywords will be passed through the method to other methods.

...arks the method as passing keywords through
a normal argument splat. This should only be called on methods that
accept an argument splat (`*args`) but not explicit keywords or a
keyword splat. It marks the method such that if the method is called
with keyword arguments, the final hash argument is...
...marked with a special
flag such that if it is the final element of a normal argument splat to
another method call, and that method call does not include explicit
keywords or a keyword splat, the final element is interpreted as
keywords. In other words, keywords will be passed through the method to
o...
...ther methods.

This should only be used for methods that delegate keywords to another
method, and only for backwards compatibility with Ruby versions before
2.7.

This method will probably be removed at some point, as it exists only
for backwards compatibility. As it does not exist in Ruby versions...

Thread.pending_interrupt?(error = nil) -> bool (108.0)

非同期割り込みのキューが空かどうかを返します。

...

Thread.handle_interrupt は非同期割り込みの発生を延期させるのに使
用しますが、本メソッドは任意の非同期割り込みが存在するかどうかを確認す
るのに使用します。

本メソッドが true を返した場合、Thread.handle_interrupt で例...
...生させる。

def Thread.kick_interrupt_immediately
Thread.handle_interrupt(Object => :immediate) {
Thread.pass
}
end

=== 使い方

th = Thread.new{
Thread.handle_interrupt(RuntimeError => :on_blocking){
while true
...
# ここまでで割り込み...
....handle_interrupt(Object => :immediate){}
end
...
end
}
}
...
th.raise # スレッド停止。

この例は以下のように記述する事もできます。

flag = true
th = Thread.new{
Thread.handle_interrupt(RuntimeError => :on_blocking){
while tru...

絞り込み条件を変える