168件ヒット
[1-100件を表示]
(0.024秒)
別のキーワード
クラス
- BasicSocket (12)
- Date (24)
- Object (30)
-
Prime
:: EratosthenesGenerator (36) -
REXML
:: Child (24) -
REXML
:: Element (12) -
RubyVM
:: InstructionSequence (12) - ThreadsWait (6)
-
Zlib
:: Inflate (12)
キーワード
- << (12)
- >> (12)
- getpeereid (12)
-
next
_ element (12) -
next
_ sibling= (12) -
next
_ wait (6) -
next
_ year (12) -
previous
_ sibling= (12) - rewind (12)
- succ (12)
- then (14)
-
to
_ a (12) -
yield
_ self (16)
検索結果
先頭5件
-
Prime
:: EratosthenesGenerator # next -> Integer (18126.0) -
次の(擬似)素数を返します。なお、この実装においては擬似素数は真に素数です。
...いては擬似素数は真に素数です。
また内部的な列挙位置を進めます。
//emlist[例][ruby]{
require 'prime'
generator = Prime::EratosthenesGenerator.new
p generator.next #=> 2
p generator.next #=> 3
p generator.succ #=> 5
p generator.succ #=> 7
p generator.next #=> 11
//}... -
Date
# next _ year(n = 1) -> Date (6126.0) -
n 年後を返します。
...す。
self >> (n * 12) に相当します。
//emlist[例][ruby]{
require 'date'
Date.new(2001,2,3).next_year #=> #<Date: 2002-02-03 ...>
Date.new(2008,2,29).next_year #=> #<Date: 2009-02-28 ...>
Date.new(2008,2,29).next_year(4) #=> #<Date: 2012-02-29 ...>
//}
Date#>> も参照して... -
REXML
:: Element # next _ element -> Element | nil (6120.0) -
次の兄弟要素を返します。
...次の兄弟要素を返します。
次の要素が存在しない場合は nil を返します。
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new '<a><b/>text<c/></a>'
doc.root.elements['b'].next_element # => <c/>
doc.root.elements['c'].next_element # => nil
//}... -
REXML
:: Child # next _ sibling=(other) (6114.0) -
other を self の次の隣接ノードとします。
...後ろに
other を挿入します。
@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/><... -
ThreadsWait
# next _ wait(nonblock = nil) -> Thread (6114.0) -
指定したスレッドのどれかが終了するまで待ちます。
...rue でかつ、キューが空の時、発生します。
#使用例
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... -
Prime
:: EratosthenesGenerator # succ -> Integer (3026.0) -
次の(擬似)素数を返します。なお、この実装においては擬似素数は真に素数です。
...いては擬似素数は真に素数です。
また内部的な列挙位置を進めます。
//emlist[例][ruby]{
require 'prime'
generator = Prime::EratosthenesGenerator.new
p generator.next #=> 2
p generator.next #=> 3
p generator.succ #=> 5
p generator.succ #=> 7
p generator.next #=> 11
//}... -
Prime
:: EratosthenesGenerator # rewind -> nil (31.0) -
列挙状態を巻き戻します。
...列挙状態を巻き戻します。
//emlist[例][ruby]{
require 'prime'
generator = Prime::EratosthenesGenerator.new
p generator.next #=> 2
p generator.next #=> 3
p generator.next #=> 5
generator.rewind
p generator.next #=> 2
//}... -
Date
# >>(n) -> Date (25.0) -
self から n ヶ月後の日付オブジェクトを返します。 n は数値でなければなりません。
...//emlist[][ruby]{
require 'date'
Date.new(2001,2,3) >> 1 #=> #<Date: 2001-03-03 ...>
Date.new(2001,2,3) >> -2 #=> #<Date: 2000-12-03 ...>
//}
対応する月に同じ日が存在しない時は、代わりにその月の末日が使われます。
//emlist[][ruby]{
require 'date'
Date.new(......かもしれません。
//emlist[][ruby]{
require 'date'
Date.new(2001,1,31) >> 2 #=> #<Date: 2001-03-31 ...>
Date.new(2001,1,31) >> 1 >> 1 #=> #<Date: 2001-03-28 ...>
Date.new(2001,1,31) >> 1 >> -1 #=> #<Date: 2001-01-28 ...>
//}
Date#next_month も参照してください。
@par... -
Object
# then -> Enumerator (19.0) -
self を引数としてブロックを評価し、ブロックの結果を返します。
...uby]{
3.next.then {|x| x**x }.to_s # => "256"
"my string".yield_self {|s| s.upcase } # => "MY STRING"
//}
値をメソッドチェインのパイプラインに次々と渡すのは良い使い方です。
//emlist[メソッドチェインのパイプライン][ruby]{
require 'open-u... -
Object
# then {|x| . . . } -> object (19.0) -
self を引数としてブロックを評価し、ブロックの結果を返します。
...uby]{
3.next.then {|x| x**x }.to_s # => "256"
"my string".yield_self {|s| s.upcase } # => "MY STRING"
//}
値をメソッドチェインのパイプラインに次々と渡すのは良い使い方です。
//emlist[メソッドチェインのパイプライン][ruby]{
require 'open-u...