285件ヒット
[101-200件を表示]
(0.079秒)
ライブラリ
- ビルトイン (84)
- dbm (12)
- gdbm (12)
-
net
/ http (36) - pstore (12)
-
rubygems
/ remote _ fetcher (12) -
rubygems
/ spec _ fetcher (24) - tsort (93)
クラス
- DBM (12)
- GDBM (12)
-
Gem
:: RemoteFetcher (12) -
Gem
:: SpecFetcher (24) - Hash (68)
- KeyError (16)
- PStore (12)
モジュール
-
Net
:: HTTPHeader (36) - TSort (93)
キーワード
- [] (12)
-
each
_ strongly _ connected _ component (23) -
each
_ strongly _ connected _ component _ from (23) -
fetch
_ path (12) -
fetch
_ values (20) - key (8)
-
latest
_ specs (12) - receiver (8)
- specs (12)
-
strongly
_ connected _ components (12) - tsort (12)
-
tsort
_ each (23)
検索結果
先頭5件
-
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 } # =>... -
Hash
# fetch _ values(key , . . . ) -> [object] (15139.0) -
引数で指定されたキーに関連づけられた値の配列を返します。
...=> "feline", "dog" => "canine", "cow" => "bovine" }
h.fetch_values("cow", "cat") # => ["bovine", "feline"]
h.fetch_values("cow", "bird") # raises KeyError
h.fetch_values("cow", "bird") { |k| k.upcase } # => ["bovine", "BIRD"]
//}
@see Hash#values_at, Hash#fetch... -
Hash
# fetch _ values(key , . . . ) { |key| . . . } -> [object] (15139.0) -
引数で指定されたキーに関連づけられた値の配列を返します。
...=> "feline", "dog" => "canine", "cow" => "bovine" }
h.fetch_values("cow", "cat") # => ["bovine", "feline"]
h.fetch_values("cow", "bird") # raises KeyError
h.fetch_values("cow", "bird") { |k| k.upcase } # => ["bovine", "BIRD"]
//}
@see Hash#values_at, Hash#fetch... -
Gem
:: RemoteFetcher # fetch _ path(uri , mtime = nil , head = false) -> String | Hash (9203.0) -
与えられた URI からダウンロードしたデータを文字列として返します。
与えられた URI からダウンロードしたデータを文字列として返します。
ヘッダ情報のみ取得した場合はハッシュを返します。
@param uri データ取得先の URI を指定します。
@param mtime 更新時刻を指定します。
@param head 真を指定するとヘッダ情報のみ取得します。 -
Hash
# [](key) -> object | nil (9073.0) -
key に関連づけられた値を返します。
...る必要が
ある場合は 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... -
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...