7件ヒット
[1-7件を表示]
(0.290秒)
ライブラリ
- ビルトイン (7)
モジュール
- Process (1)
キーワード
- define (2)
- exec (1)
-
report
_ on _ exception (1) -
report
_ on _ exception= (1)
検索結果
先頭5件
-
Fiber
. current -> Fiber (78361.0) -
このメソッドが評価されたコンテキストにおける Fiber のインスタンスを返します。
このメソッドが評価されたコンテキストにおける Fiber のインスタンスを返します。
//emlist[例:][ruby]{
fr = Fiber.new do
Fiber.current
end
fb = fr.resume
p fb.equal?(fr) # => true
p Fiber.current # => #<Fiber:0x91345e4>
p Fiber.current # => #<Fiber:0x91345e4>
//} -
Thread
. current -> Thread (78325.0) -
現在実行中のスレッド(カレントスレッド)を返します。
現在実行中のスレッド(カレントスレッド)を返します。
p Thread.current #=> #<Thread:0x4022e6fc run> -
Data
. define(*args) -> Class (24040.0) -
Data クラスに新しいサブクラスを作って、それを返します。
Data クラスに新しいサブクラスを作って、それを返します。
サブクラスでは値オブジェクトのメンバに対するアクセスメソッドが定義されています。
//emlist[例][ruby]{
Dog = Data.define(:name, :age)
fred = Dog.new("Fred", 5)
p fred.name # => "Fred"
p fred.age # => 5
//}
メンバの値を書き換えることはできません。
//emlist[例][ruby]{
Dog = Data.define(:name, :age)
fred = Dog.new("Fred", 5)
fre... -
Data
. define(*args) {|subclass| block } -> Class (24040.0) -
Data クラスに新しいサブクラスを作って、それを返します。
Data クラスに新しいサブクラスを作って、それを返します。
サブクラスでは値オブジェクトのメンバに対するアクセスメソッドが定義されています。
//emlist[例][ruby]{
Dog = Data.define(:name, :age)
fred = Dog.new("Fred", 5)
p fred.name # => "Fred"
p fred.age # => 5
//}
メンバの値を書き換えることはできません。
//emlist[例][ruby]{
Dog = Data.define(:name, :age)
fred = Dog.new("Fred", 5)
fre... -
Process
. exec(command , *args) -> () (24022.0) -
カレントプロセスを与えられた外部コマンドで置き換えます。
カレントプロセスを与えられた外部コマンドで置き換えます。
=== 引数の解釈
引数が一つだけ与えられた場合、command が shell のメタ文字
//emlist{
* ? {} [] <> () ~ & | \ $ ; ' ` " \n
//}
を含む場合、shell 経由で実行されます。
そうでなければインタプリタから直接実行されます。
引数が複数与えられた場合、第 2 引数以降は command に直接渡され、
インタプリタから直接実行されます。
第 1 引数が 2 要素の配列の場合、第 1 要素の文字列が実際に起動する
プログラムのパスで、第 2 要素が「みせかけ... -
Thread
. report _ on _ exception -> bool (24022.0) -
真の時は、いずれかのスレッドが例外によって終了した時に、その内容を $stderr に報告します。
真の時は、いずれかのスレッドが例外によって終了した時に、その内容を $stderr に報告します。
デフォルトは true です。
Thread.new { 1.times { raise } }
は $stderr に以下のように出力します:
#<Thread:...> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
2: from -e:1:in `block in <main>'
1: fro... -
Thread
. report _ on _ exception=(newstate) (24022.0) -
真の時は、いずれかのスレッドが例外によって終了した時に、その内容を $stderr に報告します。
真の時は、いずれかのスレッドが例外によって終了した時に、その内容を $stderr に報告します。
デフォルトは true です。
Thread.new { 1.times { raise } }
は $stderr に以下のように出力します:
#<Thread:...> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
2: from -e:1:in `block in <main>'
1: fro...