るりまサーチ

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

別のキーワード

  1. _builtin to_c
  2. etc sc_2_c_dev
  3. etc sc_2_c_bind
  4. tracer display_c_call
  5. tracer display_c_call=

検索結果

<< 1 2 3 ... > >>

Enumerator#next -> object (18244.0)

「次」のオブジェクトを返します。

...変化しません。
つまりもう一度 next を呼ぶと再び例外が発生します。

next
メソッドによる外部列挙の状態は他のイテレータメソッドによる
内部列挙には影響を与えません。
ただし、 IO#each_line のようにおおもとの列挙メカ...
...1][ruby]{
str = "xyz"
enum = str.each_byte

str.bytesize.times do
puts enum.next
end
# => 120
# 121
# 122
//}

//emlist[例2][ruby]{
str = "xyz"
enum = str.each_byte

begin
puts enum.next while true
rescue StopIteration
puts "iteration reached at end"
end
# => 120
#...
...121
# 122
# iteration reached at end
puts enum.next
#=> 再度 StopIteration 例外が発生
//}

//emlist[例3: Kernel.#loop は StopIteration を捕捉します。][ruby]{
str = "xyz"
enum = str.each_byte
loop do
puts enum.next
end
# => 120
# 121
# 122
//}...

String#next -> String (18108.0)

self の「次の」文字列を返します。

...a".succ # => "ab"
p "88".succ.succ # => "90"
//}

"99" → "100", "AZZ" → "BAA" のような繰り上げも行われます。
このとき負符号などは考慮されません。

//emlist[][ruby]{
p "99".succ # => "100"
p "ZZ".succ # => "AAA"
p "a9".succ # => "b0"
p "-9".succ #...
...は保存されます。

//emlist[][ruby]{
p "1.9.9".succ # => # "2.0.0"
//}

逆に self がアルファベットや数字をまったく含まない場合は、
単純に文字コードを 1 増やします。

//emlist[][ruby]{
p ".".succ # => "/"
//}

さらに、self が空文字列の場...
...ucc と逆の動作をするメソッドはありません。
また、succ という名前の由来は successor です。


//emlist[例][ruby]{
p "aa".succ # => "ab"

# 繰り上がり
p "99".succ # => "100"
p "a9".succ # => "b0"
p "Az".succ # => "Ba"
p "zz".succ # => "aaa"
p "-9".succ...

REXML::Child#next_sibling=(other) (9132.0)

other を self の次の隣接ノードとします。

...ther を挿入します。

@param other 挿入するノード

//emlist[][ruby]{
require 'rexml/document'

a = REXML::Element.new("a")
b = a.add_element("b")
c
= REXML::Element.new("c")
b.next_sibling = c
d = REXML::Element.new("d")
b.previous_sibling = d

p a.to_s # => "<a><d/><b/><c/></a>"
//}...

REXML::Child#next_sibling -> REXML::Node (9114.0)

次の隣接ノードを返します。

...次の隣接ノードを返します。

REXML::Node#next_sibling_node の別名です。

@see REXML::Child#next_sibling=...

OpenSSL::X509::CRL#next_update=(time) (9108.0)

CRL の次回更新日時を Time オブジェクトで設定します。

...CRL の次回更新日時を Time オブジェクトで設定します。

@param time 最終更新日時
@raise OpenSSL::X509::CRLError 設定に失敗した場合に発生します
@see OpenSSL::X509::CRL#next_update...

絞り込み条件を変える

OpenSSL::X509::CRL#next_update -> Time (9102.0)

CRL の次回更新日時を Time オブジェクトで返します。

...CRL の次回更新日時を Time オブジェクトで返します。...

Racc::Parser#next_token (9102.0)

@todo

@todo

ThreadsWait#next_wait(nonblock = nil) -> Thread (6214.0)

指定したスレッドのどれかが終了するまで待ちます。

...ちます。

@param nonblock true を与えると、キューが空の時、例外 ThreadsWait::ErrNoFinishedThread が発生します。

@raise ErrNoWaitingThread 終了をまつスレッドが存在しない時、発生します。

@raise ErrNoFinishedThread nonblock がtrue でかつ、キュ...
...ーが空の時、発生します。

#使用例
require 'thwait'

threads = []
2.times {|i|
threads << Thread.new { sleep i }
}

thall = ThreadsWait.new
thall.join_nowait(*threads)
until thall.empty?
th = thall.next_wait
p th
end

@see Queue#pop...

Enumerator#next_values -> Array (6210.0)

「次」のオブジェクトを配列で返します。

...を配列で返します。

Enumerator#next とほぼ同様の挙動をします。終端まで到達した場合は
StopIteration 例外を発生させます。

このメソッドは、
yield

yield nil
を区別するために使えます。

next
メソッドによる外部列挙の状...
...#each_line のようにおおもとの列挙メカニズムが副作用を
伴っている場合には影響があり得ます。

//emlist[例: next next_values の違いを][ruby]{
o = Object.new
def o.each
yield
yield 1
yield 1, 2
yield nil
yield [1, 2]
end
e = o.to_enum
p e.next_va...
...lues
p e.next_values
p e.next_values
p e.next_values
p e.next_values
e = o.to_enum
p e.next
p e.next
p e.next
p e.next
p e.next

## yield args next_values next
# yield [] nil
# yield 1 [1] 1
# yield 1, 2 [1, 2] [1, 2]
# yi...
<< 1 2 3 ... > >>