384件ヒット
[101-200件を表示]
(0.140秒)
ライブラリ
- ビルトイン (174)
- csv (12)
- delegate (12)
- forwardable (24)
-
irb
/ cmd / pushws (12) - mkmf (48)
- psych (36)
-
rexml
/ document (36) - shell (12)
- thread (18)
クラス
- Array (60)
-
CSV
:: Table (12) -
IRB
:: ExtendCommand :: PushWorkspace (12) -
Psych
:: Visitors :: YAMLTree (36) -
REXML
:: Parent (36) - Shell (12)
- Thread (24)
-
Thread
:: Queue (36) -
Thread
:: SizedQueue (72)
モジュール
- Forwardable (24)
- Kernel (60)
キーワード
- << (36)
- DelegateClass (12)
- add (12)
-
def
_ delegator (12) -
def
_ instance _ delegator (12) - deq (24)
-
enable
_ config (24) - enq (12)
- execute (12)
- join (36)
- pop (36)
- pushd (6)
- pushdir (6)
- shift (48)
- start (12)
- unshift (12)
-
with
_ config (24)
検索結果
先頭5件
- Forwardable
# def _ delegator(accessor , method , ali = method) -> () - Forwardable
# def _ instance _ delegator(accessor , method , ali = method) -> () - Kernel
# with _ config(config , default = nil) -> bool | String - Kernel
# with _ config(config , default = nil) {|config , default| . . . } -> bool | String - Psych
:: Visitors :: YAMLTree # start(encoding = Nodes :: Stream :: UTF8) -> Psych :: Nodes :: Stream
-
Forwardable
# def _ delegator(accessor , method , ali = method) -> () (6131.0) -
メソッドの委譲先を設定します。
...委譲先を設定します。
@param accessor 委譲先のオブジェクト
@param method 委譲先のメソッド
@param ali 委譲元のメソッド
委譲元のオブジェクトで ali が呼び出された場合に、
委譲先のオブジェクトの method へ処理が委譲されるよ......tor は def_instance_delegator の別名になります。
//emlist[例][ruby]{
require 'forwardable'
class MyQueue
extend Forwardable
attr_reader :queue
def initialize
@queue = []
end
def_delegator :@queue, :push, :mypush
end
q = MyQueue.new
q.mypush 42
q.queue # => [42]
q.push......23 # => NoMethodError
//}
@see Forwardable#def_delegators... -
Forwardable
# def _ instance _ delegator(accessor , method , ali = method) -> () (6131.0) -
メソッドの委譲先を設定します。
...委譲先を設定します。
@param accessor 委譲先のオブジェクト
@param method 委譲先のメソッド
@param ali 委譲元のメソッド
委譲元のオブジェクトで ali が呼び出された場合に、
委譲先のオブジェクトの method へ処理が委譲されるよ......tor は def_instance_delegator の別名になります。
//emlist[例][ruby]{
require 'forwardable'
class MyQueue
extend Forwardable
attr_reader :queue
def initialize
@queue = []
end
def_delegator :@queue, :push, :mypush
end
q = MyQueue.new
q.mypush 42
q.queue # => [42]
q.push......23 # => NoMethodError
//}
@see Forwardable#def_delegators... -
Kernel
# with _ config(config , default = nil) -> bool | String (6119.0) -
configure のオプションを検査します。
...--with-<config> が指定された場合は真を返しま
す。--without-<config> が指定された場合は偽を返します。どちらでもない場
合は default を返します。
これはデバッグ情報などのカスタム定義を、追加するのに役立ちます。
@param con......fig configure のオプションの名前を指定します。
@param default デフォルト値を返します。
例
require 'mkmf'
if with_config("debug")
$defs.push("-DOSSL_DEBUG") unless $defs.include? "-DOSSL_DEBUG"
end... -
Kernel
# with _ config(config , default = nil) {|config , default| . . . } -> bool | String (6119.0) -
configure のオプションを検査します。
...--with-<config> が指定された場合は真を返しま
す。--without-<config> が指定された場合は偽を返します。どちらでもない場
合は default を返します。
これはデバッグ情報などのカスタム定義を、追加するのに役立ちます。
@param con......fig configure のオプションの名前を指定します。
@param default デフォルト値を返します。
例
require 'mkmf'
if with_config("debug")
$defs.push("-DOSSL_DEBUG") unless $defs.include? "-DOSSL_DEBUG"
end... -
Psych
:: Visitors :: YAMLTree # start(encoding = Nodes :: Stream :: UTF8) -> Psych :: Nodes :: Stream (6119.0) -
Ruby オブジェクトから YAML AST への変換のための準備をします。
...Ruby オブジェクトから YAML AST への変換のための準備をします。
Psych::Visitors::YAMLTree#push が呼び出されたとき、
まだこのメソッドが呼び出されていなければ push メソッドがこの
メソッドを呼び出し、変換の準備をします。
e......ncoding には以下のいずれかを指定できます。
* Psych::Nodes::Node::UTF8
* Psych::Nodes::Node::UTF16BE
* Psych::Nodes::Node::UTF16LE
@param encoding YAML AST に設定するエンコーディング... -
Thread
:: Queue # shift(non _ block = false) -> object (6119.0) -
キューからひとつ値を取り出します。キューが空の時、呼出元のスレッドは停止します。
...@param non_block true を与えると、キューが空の時に例外 ThreadError が発生します。
//emlist[例][ruby]{
require 'thread'
q = Queue.new
th1 = Thread.start do
while resource = q.pop
puts resource
end
end
[:resource1, :resource2, :resource3, nil].each { |r|
q.push(r......)
}
th1.join
//}
//emlist[例: nonblock = true][ruby]{
require 'thread'
q = Queue.new
th1 = Thread.start do
while resource = q.pop
puts resource
end
end
[:resource1, :resource2, :resource3, nil].each { |r|
q.push(r)
}
begin
th1.join
q.pop(true)
rescue => e
p e
end
# => resourc......e1
# resource2
# resource3
# => #<ThreadError: queue empty>
# => "queue empty"
//}... -
Array
# shift(n) -> Array (6113.0) -
配列の先頭の要素を取り除いてそれを返します。 引数を指定した場合はその個数だけ取り除き、それを配列で返します。
...法として使えます。
@param n 自身から取り除きたい要素の個数を非負整数で指定します。
整数以外のオブジェクトを指定した場合は to_int メソッドによる暗
黙の型変換を試みます。
@raise TypeError 引数に整数以外......@raise ArgumentError 引数に負の数を指定した場合に発生します。
//emlist[例][ruby]{
a = [0, 1, 2, 3, 4]
p a.shift #=> 0
p a #=> [1, 2, 3, 4]
p [].shift #=> nil
p [].shift(1) #=> []
//}
@see Array#push, Array#pop, Array#unshift... -
Array
# unshift(*obj) -> self (6113.0) -
指定された obj を引数の最後から順番に配列の先頭に挿入します。 引数を指定しなければ何もしません。
...@param obj 自身に追加したいオブジェクトを指定します。
//emlist[例][ruby]{
arr = [1,2,3]
arr.unshift 0
p arr #=> [0, 1, 2, 3]
arr.unshift [0]
p arr #=> [[0], 0, 1, 2, 3]
arr.unshift 1, 2
p arr #=> [1, 2, [0], 0, 1, 2, 3]
//}
@see Array#push,......Array#pop, Array#shift... -
Kernel
# DelegateClass(superclass) -> object (6113.0) -
クラス superclass のインスタンスへメソッドを委譲するクラスを定義し、 そのクラスを返します。
...ラスを定義し、
そのクラスを返します。
@param superclass 委譲先となるクラス
例:
//emlist{
require 'delegate'
class ExtArray < DelegateClass(Array)
def initialize
super([])
end
end
a = ExtArray.new
p a.class # => ExtArray
a.push 25
p a # => [25]
//}... -
Thread
# join(limit) -> self | nil (3137.0) -
スレッド self の実行が終了するまで、カレントスレッドを停止し ます。self が例外により終了していれば、その例外がカレントス レッドに対して発生します。
...レッドに対して発生します。
limit を指定して、limit 秒過ぎても自身が終了しない場合、nil を返します。
@param limit タイムアウトする時間を整数か小数で指定します。単位は秒です。
@raise ThreadError join を実行することによ......。
以下は、生成したすべてのスレッドの終了を待つ例です。
threads = []
threads.push(Thread.new { n = rand(5); sleep n; n })
threads.push(Thread.new { n = rand(5); sleep n; n })
threads.push(Thread.new { n = rand(5); sleep n; n })
threads.each {|t| t.join}...