るりまサーチ

最速Rubyリファレンスマニュアル検索!
154件ヒット [1-100件を表示] (0.129秒)

別のキーワード

  1. string []=
  2. string slice
  3. string []
  4. string slice!
  5. string gsub

ライブラリ

モジュール

キーワード

検索結果

<< 1 2 > >>

DBM#fetch(key, ifnone = nil) -> String (18233.0)

データベースからキーを探して対応する要素の値を返します。

...('aaa.db', 0666, DBM::NEWDB)
db1[:a] = 'aaa'
db1[:b] = 'bbbbbb'
p db1.fetch('a') #=> 'aaa'
p db1.fetch('z', 'zzz') #=> 'zzz'
p db1.fetch('z'){|key| [:key, key] } #=> [:key, 'z']
p db1.fetch('z') #=> IndexError 発生

@see Hash#fetch...

Net::HTTPHeader#fetch(key) -> String (18231.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) {|hash| .... } -> String (18231.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 (18231.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 真を指定するとヘッダ情報のみ取得します。

絞り込み条件を変える

Net::IMAP::FetchData#attr -> { String => object } (3126.0)

各メッセージのアトリビュートの値をハッシュテーブルで返します。

...ベロープ。
Net::IMAP::Envelope オブジェクト。
: FLAGS
メッセージにセットされたフラグ。
Symbol の配列。String#capitalize でキャピタライズ
されている。
: INTERNALDATE
メッセージの内部日付。文字列。
: RFC822
BODY[] と...
...BODY.PEEK[HEADER] と同じ。文字列。
: RFC822.SIZE
メッセージの 822 サイズ。整数。
: RFC822.TEXT
BODY[TEXT] と同じ。文字列。
: UID
UID。整数。

詳しくは 2060 の FETCH command の節を見てください。

@see Net::IMAP#fetch, Net::IMAP#uid_fetch...

Gem::RemoteFetcher#download(spec, source_uri, install_dir = Gem.dir) -> String (3102.0)

source_uri から取得した Gem パッケージをキャッシュディレクトリに配置します。

...スを指定します。

@param source_uri 取得先の URI を指定します。

@param install_dir ダウンロードしたファイルの配置先を指定します。

@return ローカルにコピーした Gem ファイルのパスを返します。

@raise Gem::RemoteFetcher::FetchError...

Gem::RemoteFetcher#escape(str) -> String (3102.0)

URI 文字列をエンコードした文字列を返します。

URI 文字列をエンコードした文字列を返します。

@param str 文字列を指定します。

@see URI.escape

Gem::RemoteFetcher#get_file_uri_path(uri) -> String (3102.0)

与えられた URI から "file://" を取り除いた文字列を返します。

与えられた URI から "file://" を取り除いた文字列を返します。

@param uri URI を表す文字列を指定します。

Gem::RemoteFetcher#normalize_uri(uri) -> String (3102.0)

URI のスキーム部分が欠けている場合に "http://" を補って返します。

URI のスキーム部分が欠けている場合に "http://" を補って返します。

@param uri URI 文字列を指定します。

絞り込み条件を変える

<< 1 2 > >>