るりまサーチ

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

別のキーワード

  1. _builtin fetch
  2. env fetch
  3. net/http fetch
  4. array fetch
  5. dbm fetch

検索結果

Gem::RemoteFetcher.fetcher -> Gem::RemoteFetcher (30402.0)

このクラスの唯一のインスタンスを返します。

このクラスの唯一のインスタンスを返します。

Gem::SpecFetcher.fetcher -> Gem::SpecFetcher (30402.0)

このクラスの唯一のインスタンスを返します。

このクラスの唯一のインスタンスを返します。

Gem::RemoteFetcher.fetcher=(fetcher) (18403.0)

テスト用のメソッドです。

テスト用のメソッドです。

Gem::SpecFetcher.fetcher=(fetcher) (18403.0)

@todo

@todo

Gem::RemoteFetcher::FetchError.new(message, uri) -> Gem::RemoteFetcher::FetchError (12401.0)

この例外クラスを初期化します。

この例外クラスを初期化します。

@param message メッセージを指定します。

@param uri 問題が発生した URI を指定します。

絞り込み条件を変える

Data.define(*args) -> Class (31.0)

Data クラスに新しいサブクラスを作って、それを返します。

...Fetcher
Response = Data.define(:body)
NotFound = Data.define

def get(url)
# ダミーの実装
if url == "http://example.com/"
Response.new(body: "Current time is #{Time.now}")
else
NotFound.new
end
end
end

def fetch(url)
fetcher
= HTTPFetcher.new
case fetch...
...er.get(url)
in HTTPFetcher::Response(body)
body
in HTTPFetcher::NotFound
:NotFound
end
end

p fetch("http://example.com/") # => "Current time is 2023-01-10 10:00:53 +0900"
p fetch("http://example.com/404") # => :NotFound
//}

@param args 値オブジェクトのクラスを定義...

Data.define(*args) {|subclass| block } -> Class (31.0)

Data クラスに新しいサブクラスを作って、それを返します。

...Fetcher
Response = Data.define(:body)
NotFound = Data.define

def get(url)
# ダミーの実装
if url == "http://example.com/"
Response.new(body: "Current time is #{Time.now}")
else
NotFound.new
end
end
end

def fetch(url)
fetcher
= HTTPFetcher.new
case fetch...
...er.get(url)
in HTTPFetcher::Response(body)
body
in HTTPFetcher::NotFound
:NotFound
end
end

p fetch("http://example.com/") # => "Current time is 2023-01-10 10:00:53 +0900"
p fetch("http://example.com/404") # => :NotFound
//}

@param args 値オブジェクトのクラスを定義...