ライブラリ
- ビルトイン (182)
- dbm (11)
- gdbm (11)
-
net
/ http (33) -
net
/ imap (66) - nkf (11)
- observer (11)
- pstore (11)
-
rinda
/ tuplespace (11) -
rubygems
/ remote _ fetcher (176) -
rubygems
/ spec _ fetcher (132) - sdbm (11)
- socket (22)
- tsort (85)
-
yaml
/ dbm (22)
クラス
- Array (33)
- DBM (11)
- Data (4)
- GDBM (11)
-
Gem
:: RemoteFetcher (154) -
Gem
:: RemoteFetcher :: FetchError (22) -
Gem
:: SpecFetcher (132) - Hash (84)
- KeyError (14)
-
Net
:: IMAP (44) -
Net
:: IMAP :: FetchData (22) - PStore (11)
-
Rinda
:: TupleEntry (11) - SDBM (11)
- Socket (11)
- Thread (14)
-
YAML
:: DBM (22)
モジュール
-
Net
:: HTTPHeader (33) -
Socket
:: Constants (11) - TSort (85)
オブジェクト
- ENV (33)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) -
MSG
_ ERRQUEUE (22) -
NEWS for Ruby 2
. 1 . 0 (11) -
NEWS for Ruby 2
. 3 . 0 (9) -
NEWS for Ruby 2
. 5 . 0 (7) - NKF (11)
- Observable (11)
- [] (29)
- attr (11)
-
cache
_ dir (11) -
connection
_ for (11) - define (4)
- dir (11)
- download (11)
-
each
_ strongly _ connected _ component (21) -
each
_ strongly _ connected _ component _ from (21) - escape (11)
-
fetch
_ path (11) -
fetch
_ size (11) -
fetch
_ spec (11) -
fetch
_ values (18) - fetcher (22)
-
file
_ uri? (11) -
find
_ matching (11) -
get
_ file _ uri _ path (11) -
get
_ proxy _ from _ env (11) - key (7)
-
latest
_ specs (11) -
legacy
_ repos (11) - list (11)
-
load
_ specs (11) -
net
/ http (11) -
net
/ imap (11) - new (33)
-
normalize
_ uri (11) -
open
_ uri _ or _ path (11) - receiver (7)
- request (11)
- reset (11)
-
rubygems
/ commands / fetch _ command (11) - seqno (11)
- specs (11)
- store (11)
-
strongly
_ connected _ components (11) - tsort (22)
-
tsort
_ each (21) -
uid
_ fetch (11) -
uid
_ store (11) - unescape (11)
- uri (11)
-
warn
_ legacy (11)
検索結果
先頭5件
-
Gem
:: SpecFetcher # fetch(dependency , all = false , matching _ platform = true) -> Array (21201.0) -
依存関係を満たす gemspec の配列を返します。
依存関係を満たす gemspec の配列を返します。
@param dependency 依存関係を指定します。
@param all 真を指定するとマッチする全てのバージョンの情報を返します。
@param matching_platform 偽を指定すると全てのプラットフォームの情報を返します。
@see Gem::Dependency -
Net
:: IMAP # fetch(set , attr) -> [Net :: IMAP :: FetchData] (18353.0) -
FETCH コマンドを送り、メールボックス内のメッセージに 関するデータを取得します。
...
FETCH コマンドを送り、メールボックス内のメッセージに
関するデータを取得します。
Net::IMAP#examine もしくは Net::IMAP#select で
指定したメールボックスを対象とします。
set で対象とするメッセージを指定します。
これには......ついては Net::IMAP::FetchData#attr
を見てください。
例:
p imap.fetch(6..8, "UID")
#=> [#<Net::IMAP::FetchData seqno=6, attr={"UID"=>98}>, #<Net::IMAP::FetchData seqno=7, attr={"UID"=>99}>, #<Net::IMAP::FetchData seqno=8, attr={"UID"=>100}>]
p imap.fetch(6, "BODY[HEADER.FIELDS (......")
#=> [#<Net::IMAP::FetchData seqno=6, attr={"BODY[HEADER.FIELDS (SUBJECT)]"=>"Subject: test\r\n\r\n"}>]
data = imap.uid_fetch(98, ["RFC822.SIZE", "INTERNALDATE"])[0]
p data.seqno
#=> 6
p data.attr["RFC822.SIZE"]
#=> 611
p data.attr["INTERNALDATE"]
#=> "12-Oct-2000 22:40:59 +0900"... -
Net
:: HTTPHeader # fetch(key) -> String (18263.0) -
key ヘッダフィールドを返します。
...key ヘッダフィールドを返します。
たとえばキー 'content-length' に対しては '2048'
のような文字列が得られます。キーが存在しなければ nil を返します。
該当するキーが登録されてい
ない時には、引数 default が与えられてい......q = 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-length">
end
//}
//emlist[例 key , defaul......::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 } # => 99
//... -
Net
:: HTTPHeader # fetch(key) {|hash| . . . . } -> String (18263.0) -
key ヘッダフィールドを返します。
...key ヘッダフィールドを返します。
たとえばキー 'content-length' に対しては '2048'
のような文字列が得られます。キーが存在しなければ nil を返します。
該当するキーが登録されてい
ない時には、引数 default が与えられてい......q = 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-length">
end
//}
//emlist[例 key , defaul......::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 } # => 99
//... -
Net
:: HTTPHeader # fetch(key , default) -> String (18263.0) -
key ヘッダフィールドを返します。
...key ヘッダフィールドを返します。
たとえばキー 'content-length' に対しては '2048'
のような文字列が得られます。キーが存在しなければ nil を返します。
該当するキーが登録されてい
ない時には、引数 default が与えられてい......q = 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-length">
end
//}
//emlist[例 key , defaul......::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 } # => 99
//... -
Hash
# fetch(key) -> object (18245.0) -
key に関連づけられた値を返します。該当するキーが登録されてい ない時には、引数 default が与えられていればその値を、ブロッ クが与えられていればそのブロックを評価した値を返します。
...default が与えられていればその値を、ブロッ
クが与えられていればそのブロックを評価した値を返します。
fetchはハッシュ自身にデフォルト値が設定されていても単に無視します(挙動に変化がありません)。
@param key 探......判別できない。
p h.fetch(:one) #=> nil
p h.fetch(:two) # エラー key not found (KeyError)
p h.fetch(:two,"error") #=> "error"
p h.fetch(:two){|key|"#{key} not exist"} #=> "two not exist"
p h.fetch(:two, "error"){|key|......o not exist"
"#{key} not exist" # warning: block supersedes default value argument
} # 警告が表示される。
h.default = "default"
p h.fetch(:two) # エラー key not found (KeyError)
//}
@see Hash#[]......wo not exist"
"#{key} not exist" # warning: block supersedes default value argument
} # 警告が表示される。
h.default = "default"
p h.fetch(:two) # エラー key not found (KeyError)
//}
@see Hash#[]... -
Hash
# fetch(key) {|key| . . . } -> object (18245.0) -
key に関連づけられた値を返します。該当するキーが登録されてい ない時には、引数 default が与えられていればその値を、ブロッ クが与えられていればそのブロックを評価した値を返します。
...default が与えられていればその値を、ブロッ
クが与えられていればそのブロックを評価した値を返します。
fetchはハッシュ自身にデフォルト値が設定されていても単に無視します(挙動に変化がありません)。
@param key 探......判別できない。
p h.fetch(:one) #=> nil
p h.fetch(:two) # エラー key not found (KeyError)
p h.fetch(:two,"error") #=> "error"
p h.fetch(:two){|key|"#{key} not exist"} #=> "two not exist"
p h.fetch(:two, "error"){|key|......o not exist"
"#{key} not exist" # warning: block supersedes default value argument
} # 警告が表示される。
h.default = "default"
p h.fetch(:two) # エラー key not found (KeyError)
//}
@see Hash#[]......wo not exist"
"#{key} not exist" # warning: block supersedes default value argument
} # 警告が表示される。
h.default = "default"
p h.fetch(:two) # エラー key not found (KeyError)
//}
@see Hash#[]... -
Hash
# fetch(key , default) -> object (18245.0) -
key に関連づけられた値を返します。該当するキーが登録されてい ない時には、引数 default が与えられていればその値を、ブロッ クが与えられていればそのブロックを評価した値を返します。
...default が与えられていればその値を、ブロッ
クが与えられていればそのブロックを評価した値を返します。
fetchはハッシュ自身にデフォルト値が設定されていても単に無視します(挙動に変化がありません)。
@param key 探......判別できない。
p h.fetch(:one) #=> nil
p h.fetch(:two) # エラー key not found (KeyError)
p h.fetch(:two,"error") #=> "error"
p h.fetch(:two){|key|"#{key} not exist"} #=> "two not exist"
p h.fetch(:two, "error"){|key|......o not exist"
"#{key} not exist" # warning: block supersedes default value argument
} # 警告が表示される。
h.default = "default"
p h.fetch(:two) # エラー key not found (KeyError)
//}
@see Hash#[]......wo not exist"
"#{key} not exist" # warning: block supersedes default value argument
} # 警告が表示される。
h.default = "default"
p h.fetch(:two) # エラー key not found (KeyError)
//}
@see Hash#[]... -
GDBM
# fetch(key , ifnone = nil) {|key| . . . } -> object (18237.0) -
データベースから対応するキーを探してその要素の値を返します。
...a'
db1['b'] = 'bbb'
p db1.fetch('a') #=> 'aaa'
p db1.fetch('z', 'zzz') #=> 'zzz'
p db1.fetch('z'){|key| [:key, key] } #=> [:key, 'z']
p db1.fetch('z', 'zzz'){|key| [:key, key] } #=> 'zzz'
p db1.fetch('z')......#=> IndexError 発生
@see Hash#fetch... -
Thread
# fetch(name , default = nil) {|name| . . . } -> object (18237.0) -
name に関連づけられたスレッドに固有のデータを返します。 name に対応するスレッド固有データがない時には、引数 default が 与えられていればその値を、ブロックが与えられていれば そのブロックを評価した値を返します。
...と発生します。
//emlist[例][ruby]{
th = Thread.new { Thread.current[:name] = 'A' }
th.join
th.fetch(:name) # => "A"
th.fetch(:fetch, 'B') # => "B"
th.fetch('name') {|name| "Thread" + name} # => "A"
th.fetch('fetch') {|name| "Thread" + name} # => "Threadfetch"
//}
@see Thread#[]...