ライブラリ
- ビルトイン (76)
- dbm (11)
- gdbm (11)
-
net
/ http (33) - pstore (11)
-
rubygems
/ remote _ fetcher (11) -
rubygems
/ spec _ fetcher (22) - tsort (85)
クラス
- DBM (11)
- GDBM (11)
-
Gem
:: RemoteFetcher (11) -
Gem
:: SpecFetcher (22) - Hash (62)
- KeyError (14)
- PStore (11)
モジュール
-
Net
:: HTTPHeader (33) - TSort (85)
キーワード
- [] (11)
-
each
_ strongly _ connected _ component (21) -
each
_ strongly _ connected _ component _ from (21) -
fetch
_ path (11) -
fetch
_ values (18) - key (7)
-
latest
_ specs (11) - receiver (7)
- specs (11)
-
strongly
_ connected _ components (11) - tsort (11)
-
tsort
_ each (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#[]... -
Net
:: HTTPHeader # fetch(key) -> String (18129.0) -
key ヘッダフィールドを返します。
...http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.fetch("user-agent") # => "Ruby"
//}
//emlist[例 key のみ指定。key が存在しない][ruby]{
require 'net/http'
begin
req.fetch("content-length")
rescue => e
e # => #<KeyError: key not found: "content-lengt......:HTTP::Get.new(uri.request_uri)
req.fetch("content-length", "default") # => "default"
//}
//emlist[例 key とブロックを指定][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.fetch("content-length") { |e| 99 } # =>... -
Net
:: HTTPHeader # fetch(key , default) -> String (18129.0) -
key ヘッダフィールドを返します。
...http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.fetch("user-agent") # => "Ruby"
//}
//emlist[例 key のみ指定。key が存在しない][ruby]{
require 'net/http'
begin
req.fetch("content-length")
rescue => e
e # => #<KeyError: key not found: "content-lengt......:HTTP::Get.new(uri.request_uri)
req.fetch("content-length", "default") # => "default"
//}
//emlist[例 key とブロックを指定][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.fetch("content-length") { |e| 99 } # =>... -
Gem
:: RemoteFetcher # fetch _ path(uri , mtime = nil , head = false) -> String | Hash (9203.0) -
与えられた URI からダウンロードしたデータを文字列として返します。
与えられた URI からダウンロードしたデータを文字列として返します。
ヘッダ情報のみ取得した場合はハッシュを返します。
@param uri データ取得先の URI を指定します。
@param mtime 更新時刻を指定します。
@param head 真を指定するとヘッダ情報のみ取得します。 -
Gem
:: SpecFetcher # latest _ specs -> Hash (3102.0) -
キャッシュされている最新の gemspec を返します。
キャッシュされている最新の gemspec を返します。 -
Gem
:: SpecFetcher # specs -> Hash (3102.0) -
キャッシュされている全ての gemspec を返します。
キャッシュされている全ての gemspec を返します。 -
KeyError
# key -> object (13.0) -
KeyError の原因となったメソッド呼び出しのキーを返します。
...ド呼び出しのキーを返します。
@raise ArgumentError キーが設定されていない時に発生します。
例:
h = Hash.new
begin
h.fetch('gumby'*20)
rescue KeyError => e
p e.message # => "key not found: \"gumbygumbygumbygumbygumbygumbygumbygumbygumbygumby... -
KeyError
# receiver -> object (13.0) -
KeyError の原因となったメソッド呼び出しのレシーバを返します。
...しのレシーバを返します。
@raise ArgumentError レシーバが設定されていない時に発生します。
例:
h = Hash.new
begin
h.fetch('gumby'*20)
rescue KeyError => e
p e.message # => "key not found: \"gumbygumbygumbygumbygumbygumbygumbygumbygumbygumb... -
TSort
# each _ strongly _ connected _ component -> Enumerator (13.0) -
TSort#strongly_connected_components メソッドのイテレータ版です。 obj.each_strongly_connected_component は obj.strongly_connected_components.each に似ていますが、 ブロックの評価中に obj が変更された場合は予期しない結果になる ことがあります。
...ly_connected_component は nil を返します。
//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_strongl... -
TSort
# each _ strongly _ connected _ component {|nodes| . . . } -> nil (13.0) -
TSort#strongly_connected_components メソッドのイテレータ版です。 obj.each_strongly_connected_component は obj.strongly_connected_components.each に似ていますが、 ブロックの評価中に obj が変更された場合は予期しない結果になる ことがあります。
...ly_connected_component は nil を返します。
//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_strongl... -
TSort
# each _ strongly _ connected _ component _ from(node , id _ map={} , stack=[]) -> Enumerator (13.0) -
node から到達可能な強連結成分についてのイテレータです。
...定します。
//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_strongl...