113件ヒット
[1-100件を表示]
(0.123秒)
モジュール
- TSort (33)
キーワード
- [] (8)
-
each
_ strongly _ connected _ component (11) -
each
_ strongly _ connected _ component _ from (11) - store (12)
-
tsort
_ each (11) -
uid
_ store (12)
検索結果
先頭5件
-
PStore
# fetch(name , default = PStore :: Error) -> object (21226.0) -
ルートnameに対応する値を得ます。
...を返し、
与えられていなければ例外 PStore::Error が発生します。
@param name 探索するルート。
@param default name に対応するルートが登録されていない場合に返す値を指定する。
@raise PStore::Error name に対応するルートが登録され......例:
require 'pstore'
db = PStore.new("/tmp/foo")
db.transaction do
p db.roots # => []
ary = db["root"] = [1,2,3,4]
ary[0] = [1,1.5]
end
db.transaction(true) do |pstore|
pstore.fetch("root") # => [[1, 1.5], 2, 3, 4]
pstore.fetch("root", 'aaa') # => [[......1, 1.5], 2, 3, 4]
pstore.fetch("not_root") # => 例外発生
end
@see Hash#fetch, PStore#[]... -
Array
# fetch(nth) -> object (18128.0) -
nth 番目の要素を返します。
...ram nth 取得したい要素のインデックスを整数で指定します。
整数以外のオブジェクトを指定した場合は to_int メソッドによる
暗黙の型変換を試みます。
@param ifnone 要素が存在しなかった場合に返すべき値を......しなかった場合に発生します。
//emlist[例][ruby]{
a = [1, 2, 3, 4, 5]
begin
p a.fetch(10)
rescue IndexError => err
puts err #=> index 10 out of array
end
p a.fetch(10, 999) #=> 999
result = a.fetch(10){|nth|
print "#{nth} はありません。\n"
999
}
p result #=> 999
//}... -
Array
# fetch(nth) {|nth| . . . } -> object (18128.0) -
nth 番目の要素を返します。
...ram nth 取得したい要素のインデックスを整数で指定します。
整数以外のオブジェクトを指定した場合は to_int メソッドによる
暗黙の型変換を試みます。
@param ifnone 要素が存在しなかった場合に返すべき値を......しなかった場合に発生します。
//emlist[例][ruby]{
a = [1, 2, 3, 4, 5]
begin
p a.fetch(10)
rescue IndexError => err
puts err #=> index 10 out of array
end
p a.fetch(10, 999) #=> 999
result = a.fetch(10){|nth|
print "#{nth} はありません。\n"
999
}
p result #=> 999
//}... -
Array
# fetch(nth , ifnone) -> object (18128.0) -
nth 番目の要素を返します。
...ram nth 取得したい要素のインデックスを整数で指定します。
整数以外のオブジェクトを指定した場合は to_int メソッドによる
暗黙の型変換を試みます。
@param ifnone 要素が存在しなかった場合に返すべき値を......しなかった場合に発生します。
//emlist[例][ruby]{
a = [1, 2, 3, 4, 5]
begin
p a.fetch(10)
rescue IndexError => err
puts err #=> index 10 out of array
end
p a.fetch(10, 999) #=> 999
result = a.fetch(10){|nth|
print "#{nth} はありません。\n"
999
}
p result #=> 999
//}... -
Net
:: IMAP # store(set , attr , flags) -> [Net :: IMAP :: FetchData] | nil (6207.0) -
STORE コマンドを送り、メールボックス内のメッセージを 更新します。
...STORE コマンドを送り、メールボックス内のメッセージを
更新します。
set で更新するメッセージを指定します。
これには sequence number、sequence number の配列、もしくは
Range オブジェクトを渡します。
Net::IMAP#select で指定した......を Net::IMAP::FetchData オブジェクトの
配列で返します。
例:
p imap.store(6..8, "+FLAGS", [:Deleted])
#=> [#<Net::IMAP::FetchData seqno=6, attr={"FLAGS"=>[:Seen, :Deleted]}>, #<Net::IMAP::FetchData seqno=7, attr={"FLAGS"=>[:Seen, :Deleted]}>, #<Net::IMAP::FetchData seqno=8, att......r={"FLAGS"=>[:Seen, :Deleted]}>]
@param set 更新するメッセージのsequence number
@param attr 更新方式(文字列)
@param flags 更新内容(Symbol の配列)
@see Net::IMAP#uid_store, Net::IMAP#fetch... -
Net
:: IMAP # uid _ store(set , attr , flags) -> [Net :: IMAP :: FetchData] | nil (6207.0) -
UID STORE コマンドを送り、メールボックス内のメッセージを 更新します。
...UID STORE コマンドを送り、メールボックス内のメッセージを
更新します。
set で更新するメッセージを指定します。
これには UID、UID の配列、もしくは
Range オブジェクトを渡します。
Net::IMAP#select で指定したメールボック......してください。
返り値は更新された内容を Net::IMAP::FetchData オブジェクトの
配列で返します。
@param set 更新するメッセージの UID
@param attr 更新方式(文字列)
@param flags 更新内容(Symbol の配列)
@see Net::IMAP#store, Net::IMAP#uid_fetch... -
TSort
# each _ strongly _ connected _ component -> Enumerator (107.0) -
TSort#strongly_connected_components メソッドのイテレータ版です。 obj.each_strongly_connected_component は obj.strongly_connected_components.each に似ていますが、 ブロックの評価中に obj が変更された場合は予期しない結果になる ことがあります。
...。
//emlist[使用例][ruby]{
require 'tsort'
class Hash
include TSort
alias tsort_each_node each_key
def tsort_each_child(node, &block)
fetch(node).each(&block)
end
end
non_sort = {1=>[2], 2=>[3, 4], 3=>[2], 4=>[]}
non_sort.each_strongly_connected_component{|nodes|
p nodes
}
#... -
TSort
# each _ strongly _ connected _ component _ from(node , id _ map={} , stack=[]) -> Enumerator (107.0) -
node から到達可能な強連結成分についてのイテレータです。
...ードを表示する][ruby]{
require 'tsort'
class Hash
include TSort
alias tsort_each_node each_key
def tsort_each_child(node, &block)
fetch(node).each(&block)
end
end
non_sort = {1=>[2], 2=>[3, 4], 3=>[2], 4=>[]}
non_sort.each_strongly_connected_component{|nodes|
p nodes
nodes.... -
TSort
# tsort _ each -> Enumerator (107.0) -
TSort#tsort メソッドのイテレータ版です。 obj.tsort_each は obj.tsort.each と似ていますが、 ブロックの評価中に obj が変更された場合は予期しない結果になる ことがあります。
....
//emlist[使用例][ruby]{
require 'tsort'
class Hash
include TSort
alias tsort_each_node each_key
def tsort_each_child(node, &block)
fetch(node).each(&block)
end
end
non_sort = {1=>[2, 3], 2=>[3], 3=>[], 4=>[]}
non_sort.tsort_each {|node|
non_sort.tsort_each_child(node){|child|...