るりまサーチ

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

別のキーワード

  1. _builtin end
  2. ripper end_seen?
  3. _builtin exclude_end?
  4. _builtin end_with?
  5. zlib end

ライブラリ

クラス

モジュール

検索結果

<< 1 2 3 > >>

Gem::SpecFetcher#fetch(dependency, all = false, matching_platform = true) -> Array (21226.0)

依存関係を満たす gemspec の配列を返します。

...返します。

@
param dependency 依存関係を指定します。
@
param all 真を指定するとマッチする全てのバージョンの情報を返します。
@
param matching_platform 偽を指定すると全てのプラットフォームの情報を返します。

@
see Gem::Dependency...

PStore#fetch(name, default = PStore::Error) -> object (18162.0)

ルートnameに対応する値を得ます。

...与えられていなければ例外 PStore::Error が発生します。

@
param name 探索するルート。

@
param default name に対応するルートが登録されていない場合に返す値を指定する。

@
raise PStore::Error 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 (18158.0)

key ヘッダフィールドを返します。

...返します。
key は大文字小文字を区別しません。

@
param key ヘッダフィール名を文字列で与えます。
@
param default 該当するキーが登録されていない時の返り値を指定します。
@
raise IndexError 引数defaultもブロックも与えられてない...
...t::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 , default を...
...uest_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
//}

@
see Net::HTTP...

Net::HTTPHeader#fetch(key) {|hash| .... } -> String (18158.0)

key ヘッダフィールドを返します。

...返します。
key は大文字小文字を区別しません。

@
param key ヘッダフィール名を文字列で与えます。
@
param default 該当するキーが登録されていない時の返り値を指定します。
@
raise IndexError 引数defaultもブロックも与えられてない...
...t::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 , default を...
...uest_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
//}

@
see Net::HTTP...

Net::HTTPHeader#fetch(key, default) -> String (18158.0)

key ヘッダフィールドを返します。

...返します。
key は大文字小文字を区別しません。

@
param key ヘッダフィール名を文字列で与えます。
@
param default 該当するキーが登録されていない時の返り値を指定します。
@
raise IndexError 引数defaultもブロックも与えられてない...
...t::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 , default を...
...uest_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
//}

@
see Net::HTTP...

絞り込み条件を変える

Array#fetch(nth) -> object (18152.0)

nth 番目の要素を返します。

...価した結果を返します。

@
param nth 取得したい要素のインデックスを整数で指定します。
整数以外のオブジェクトを指定した場合は to_int メソッドによる
暗黙の型変換を試みます。

@
param ifnone 要素が存在し...
...なかった場合に返すべき値を指定します。

@
raise TypeError 引数 nth に整数以外の(暗黙の型変換が行えない)オブジェ
クトを指定した場合に発生します。

@
raise IndexError 引数 ifnone もブロックも指定しておらず、 nth...
...なかった場合に発生します。

//emlist[例][ruby]{
a = [1, 2, 3, 4, 5]
begin
p a.fetch(10)
rescue IndexError => err
puts err #=> index 10 out of array
end


p a.fetch(10, 999) #=> 999

result = a.fetch(10){|nth|
print "#{nth} はありません。\n"
999
}
p result #=> 999
//}...
...しなかった場合に発生します。

//emlist[例][ruby]{
a = [1, 2, 3, 4, 5]
begin
p a.fetch(10)
rescue IndexError => err
puts err #=> index 10 out of array
end


p a.fetch(10, 999) #=> 999

result = a.fetch(10){|nth|
print "#{nth} はありません。\n"
999
}
p result #=> 999
//}...

Array#fetch(nth) {|nth| ... } -> object (18152.0)

nth 番目の要素を返します。

...価した結果を返します。

@
param nth 取得したい要素のインデックスを整数で指定します。
整数以外のオブジェクトを指定した場合は to_int メソッドによる
暗黙の型変換を試みます。

@
param ifnone 要素が存在し...
...なかった場合に返すべき値を指定します。

@
raise TypeError 引数 nth に整数以外の(暗黙の型変換が行えない)オブジェ
クトを指定した場合に発生します。

@
raise IndexError 引数 ifnone もブロックも指定しておらず、 nth...
...なかった場合に発生します。

//emlist[例][ruby]{
a = [1, 2, 3, 4, 5]
begin
p a.fetch(10)
rescue IndexError => err
puts err #=> index 10 out of array
end


p a.fetch(10, 999) #=> 999

result = a.fetch(10){|nth|
print "#{nth} はありません。\n"
999
}
p result #=> 999
//}...
...しなかった場合に発生します。

//emlist[例][ruby]{
a = [1, 2, 3, 4, 5]
begin
p a.fetch(10)
rescue IndexError => err
puts err #=> index 10 out of array
end


p a.fetch(10, 999) #=> 999

result = a.fetch(10){|nth|
print "#{nth} はありません。\n"
999
}
p result #=> 999
//}...

Array#fetch(nth, ifnone) -> object (18152.0)

nth 番目の要素を返します。

...価した結果を返します。

@
param nth 取得したい要素のインデックスを整数で指定します。
整数以外のオブジェクトを指定した場合は to_int メソッドによる
暗黙の型変換を試みます。

@
param ifnone 要素が存在し...
...なかった場合に返すべき値を指定します。

@
raise TypeError 引数 nth に整数以外の(暗黙の型変換が行えない)オブジェ
クトを指定した場合に発生します。

@
raise IndexError 引数 ifnone もブロックも指定しておらず、 nth...
...なかった場合に発生します。

//emlist[例][ruby]{
a = [1, 2, 3, 4, 5]
begin
p a.fetch(10)
rescue IndexError => err
puts err #=> index 10 out of array
end


p a.fetch(10, 999) #=> 999

result = a.fetch(10){|nth|
print "#{nth} はありません。\n"
999
}
p result #=> 999
//}...
...しなかった場合に発生します。

//emlist[例][ruby]{
a = [1, 2, 3, 4, 5]
begin
p a.fetch(10)
rescue IndexError => err
puts err #=> index 10 out of array
end


p a.fetch(10, 999) #=> 999

result = a.fetch(10){|nth|
print "#{nth} はありません。\n"
999
}
p result #=> 999
//}...

Gem::SpecFetcher#find_matching(dependency, all = false, matching_platform = true) -> Array (3125.0)

依存関係を満たす gemspec の名前の配列を返します。

...返します。

@
param dependency 依存関係を指定します。
@
param all 真を指定するとマッチする全てのバージョンの情報を返します。
@
param matching_platform 偽を指定すると全てのプラットフォームの情報を返します。

@
see Gem::Dependency...
<< 1 2 3 > >>