83件ヒット
[1-83件を表示]
(0.112秒)
クラス
- Hash (11)
-
Net
:: IMAP :: FetchData (11) - PStore (11)
-
Rinda
:: TupleEntry (11) - Thread (7)
-
YAML
:: DBM (11)
モジュール
- TSort (21)
キーワード
- attr (11)
-
each
_ strongly _ connected _ component _ from (21)
検索結果
先頭5件
-
PStore
# fetch(name , default = PStore :: Error) -> object (18132.0) -
ルートnameに対応する値を得ます。
...> []
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#[]... -
Hash
# [](key) -> object | nil (18113.0) -
key に関連づけられた値を返します。
...いない時には、デフォルト値を返します。
デフォルト値と値としての nil を区別する必要が
ある場合は Hash#fetch または Hash#key? を使ってください。
@param key 探索するキーを指定します。
//emlist[例][ruby]{
h = {:ab => "some" , :cd =......"all"}
p h[:ab] #=> "some"
p h[:ef] #=> nil
h1 = Hash.new("default value")
p h1[:non] #=> "default value"
h2 = Hash.new {|*arg| arg}
p h2[:non] #=> [{}, :non]
//}
@see Hash.new, Hash#fetch,Hash#values_at,Hash#key?, Hash#default, Hash#default_proc... -
Rinda
:: TupleEntry # [](key) (18107.0) -
タプルの key に対応する要素を返します。
...タプルの key に対応する要素を返します。
Rinda::TupleEntry#value[key] を返します。
@param key 要素を指定するキー
@see Rinda::TupleEntry#fetch... -
Thread
# [](name) -> object | nil (18107.0) -
name に対応したスレッドに固有のデータを取り出します。 name に対応するスレッド固有データがなければ nil を返し ます。
...002a541a8 dead>: B
# => #<Thread:0x00000002a54130 dead>: C
//}
Thread#[] と Thread#[]= を用いたスレッド固有の変数は
Fiber を切り替えると異なる変数を返す事に注意してください。
//emlist[][ruby]{
def meth(newvalue)
begin
oldvalue = Thread.current[:name]......d
//}
この関数に与えるブロックがFiberを切り替える場合は動的スコープとしては
正しく動作しません。
//emlist[][ruby]{
f = Fiber.new {
meth(1) {
Fiber.yield
}
}
meth(2) {
f.resume
}
f.resume
p Thread.current[:name]
# => nil if fiber-local
# => 2 if t......hread-local (The value 2 is leaked to outside of meth method.)
//}
Fiber を切り替えても同じ変数を返したい場合は
Thread#thread_variable_get と Thread#thread_variable_set
を使用してください。
@see Thread#fetch, Thread#[]=... -
YAML
:: DBM # [](key) -> object | nil (18107.0) -
データベースからキーを探して対応する要素の値を返します。
...データベースからキーを探して対応する要素の値を返します。
対応する値が見つからなかった場合は nil を返します。DBM#[] とは異
なり、IndexError は発生しません。
@param key キーを文字列で指定します。
@see YAML::DBM#fetch... -
Net
:: IMAP :: FetchData # attr -> { String => object } (3025.0) -
各メッセージのアトリビュートの値をハッシュテーブルで返します。
...: RFC822
BODY[] と同じ。文字列。
: RFC822.HEADER
BODY.PEEK[HEADER] と同じ。文字列。
: RFC822.SIZE
メッセージの 822 サイズ。整数。
: RFC822.TEXT
BODY[TEXT] と同じ。文字列。
: UID
UID。整数。
詳しくは 2060 の FETCH command の節を......見てください。
@see Net::IMAP#fetch, Net::IMAP#uid_fetch... -
TSort
# each _ strongly _ connected _ component _ from(node , id _ map={} , stack=[]) -> Enumerator (107.0) -
node から到達可能な強連結成分についてのイテレータです。
...re '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.each {|node|
non_sort.each_stro... -
TSort
# each _ strongly _ connected _ component _ from(node , id _ map={} , stack=[]) {|nodes| . . . } -> () (107.0) -
node から到達可能な強連結成分についてのイテレータです。
...re '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.each {|node|
non_sort.each_stro...