ライブラリ
- ビルトイン (653)
- csv (180)
- matrix (134)
-
net
/ http (444) - prime (48)
-
rexml
/ document (72) -
rubygems
/ commands / dependency _ command (12) -
rubygems
/ indexer (60) -
rubygems
/ source _ index (108) -
rubygems
/ source _ info _ cache _ entry (12) - socket (12)
- strscan (24)
-
yaml
/ dbm (12)
クラス
- Array (306)
- CSV (36)
-
CSV
:: FieldInfo (12) -
CSV
:: Row (72) -
CSV
:: Table (60) -
Enumerator
:: Lazy (12) -
Gem
:: Commands :: DependencyCommand (12) -
Gem
:: Indexer (60) -
Gem
:: SourceIndex (108) -
Gem
:: SourceInfoCacheEntry (12) - Hash (152)
- MatchData (40)
- Matrix (120)
-
Net
:: HTTP (144) -
Net
:: HTTPGenericRequest (48) -
Net
:: HTTPResponse (36) -
Prime
:: PseudoPrimeGenerator (48) -
REXML
:: Elements (36) -
REXML
:: Parent (36) -
Socket
:: AncillaryData (12) - String (64)
- StringScanner (24)
- Vector (14)
-
YAML
:: DBM (12)
モジュール
- Enumerable (79)
-
Net
:: HTTPHeader (216)
キーワード
- [] (72)
- []= (110)
- abbreviate (12)
-
add
_ spec (12) -
add
_ specs (12) -
basic
_ auth (12) - begin (12)
- body (12)
- body= (12)
-
body
_ stream (12) -
body
_ stream= (12) - bsearch (20)
-
bsearch
_ index (20) - bytebegin (2)
- byteend (2)
- byteindex (3)
- byterindex (3)
- bytesplice (10)
-
compact
_ specs (12) - compress (12)
-
content
_ length (12) -
content
_ length= (12) -
content
_ type= (12) - convert (36)
- delete (36)
- each (48)
-
each
_ index (24) -
each
_ with _ index (72) - end (12)
- fetch (72)
-
fetch
_ values (2) - field (12)
- fill (72)
- filter! (14)
-
find
_ gems (12) -
find
_ index (108) -
find
_ name (12) -
form
_ data= (12) -
gem
_ signature (12) - get (24)
- get2 (24)
-
get
_ fields (12) - getbyte (12)
- head (12)
- head2 (24)
- index= (12)
-
ipv6
_ pktinfo _ ifindex (12) -
keep
_ if (24) - key (7)
- key? (12)
-
load
_ gems _ in (12) - paranoid (12)
- pointer= (12)
- pos= (12)
-
proxy
_ basic _ auth (12) - range (12)
-
range
_ length (12) -
read
_ body (24) - refresh (12)
- refresh! (12)
-
request
_ get (24) -
request
_ head (24) - rindex (48)
-
sanitize
_ string (12) - search (12)
- select! (24)
-
send
_ request (12) -
set
_ content _ type (12) -
set
_ form _ data (12) - setbyte (12)
- specification (12)
-
to
_ h (19) -
transform
_ keys (20) -
transform
_ keys! (20) -
transform
_ values (18) -
transform
_ values! (18) - update (12)
- value (12)
-
values
_ at (12) -
with
_ index (36)
検索結果
先頭5件
-
Hash
# index(val) -> object (18120.0) -
値 val に対応するキーを返します。対応する要素が存在しない時には nil を返します。
...ash#index は obsolete です。
使用すると警告メッセージが表示されます。
@param val 探索に用いる値を指定します。
//emlist[例][ruby]{
h = {:ab => "some" , :cd => "all" , :ef => "all"}
p h.key("some") #=> :ab
p h.key("all") #=> :cd
p h.key("at") #=> nil
//}
@see... -
REXML
:: Elements # index(element) -> Integer (18114.0) -
element で指定した要素が何番目の子要素であるかを返します。
...element で指定した要素が何番目の子要素であるかを返します。
element が子要素でない場合は -1 を返します。
返り値は 1-origin です。
@param element インデックスを知りたい要素(REXML::Element オブジェクト)
@see REXML::Element#[]... -
YAML
:: DBM # index(value) -> String | nil (18114.0) -
value を持つ要素のキーを返します。
...らなかった場合は nil を返します。
@param value 検索したい値を指定します。YAML 形式に変換できるオブジェク
トが指定できます。
[注意] 非推奨のメソッドです。代わりに #key を使用してください。
@see YAML::DBM#key... -
Enumerable
# each _ with _ index(*args) {|item , index| . . . } -> self (6246.0) -
要素とそのインデックスをブロックに渡して繰り返します。
...り返すような
Enumerator を返します。
Enumerator#with_index は offset 引数を受け取りますが、
each_with_index は受け取りません (引数はイテレータメソッドにそのまま渡されます)。
@param args イテレータメソッド (each など) にそのまま......each_with_index do |n, idx|
p [n, idx]
end
# => [5, 0]
# [10, 1]
# [15, 2]
//}
//emlist[引数ありの例][ruby]{
require 'stringio'
StringIO.new("foo|bar|baz").each_with_index("|") do |s, i|
p [s, i]
end
# => ["foo|", 0]
# ["bar|", 1]
# ["baz", 2]
//}
@see Enumerator#with_index... -
Prime
:: PseudoPrimeGenerator # each _ with _ index {|prime , index| . . . } -> self (6243.0) -
与えられたブロックに対して、素数を0起点の連番を渡して評価します。
...ます。
@return ブロックを与えられた場合は self を返します。 ブロックを与えられなかった場合は Enumerator を返します。
//emlist[例][ruby]{
require 'prime'
Prime::EratosthenesGenerator.new(10).each_with_index do |prime, index|
p [prime, index]
end
# [2,......0]
# [3, 1]
# [5, 2]
# [7, 3]
//}
@see Enumerator#with_index... -
Prime
:: PseudoPrimeGenerator # with _ index {|prime , index| . . . } -> self (6243.0) -
与えられたブロックに対して、素数を0起点の連番を渡して評価します。
...ます。
@return ブロックを与えられた場合は self を返します。 ブロックを与えられなかった場合は Enumerator を返します。
//emlist[例][ruby]{
require 'prime'
Prime::EratosthenesGenerator.new(10).each_with_index do |prime, index|
p [prime, index]
end
# [2,......0]
# [3, 1]
# [5, 2]
# [7, 3]
//}
@see Enumerator#with_index... -
Array
# each _ index {|index| . . . . } -> self (6222.0) -
各要素のインデックスに対してブロックを評価します。
...を評価します。
以下と同じです。
//emlist[例][ruby]{
(0 ... ary.size).each do |index|
# ....
end
//}
ブロックが与えられなかった場合は、自身と each_index から生成した
Enumerator オブジェクトを返します。
@see Array#each, Array#reverse_each... -
Enumerable
# each _ with _ index(*args) -> Enumerator (6146.0) -
要素とそのインデックスをブロックに渡して繰り返します。
...り返すような
Enumerator を返します。
Enumerator#with_index は offset 引数を受け取りますが、
each_with_index は受け取りません (引数はイテレータメソッドにそのまま渡されます)。
@param args イテレータメソッド (each など) にそのまま......each_with_index do |n, idx|
p [n, idx]
end
# => [5, 0]
# [10, 1]
# [15, 2]
//}
//emlist[引数ありの例][ruby]{
require 'stringio'
StringIO.new("foo|bar|baz").each_with_index("|") do |s, i|
p [s, i]
end
# => ["foo|", 0]
# ["bar|", 1]
# ["baz", 2]
//}
@see Enumerator#with_index... -
Array
# bsearch _ index -> Enumerator (6145.0) -
ブロックの評価結果で範囲内の各要素の判定を行い、条件を満たす値の位置を 二分探索(計算量は O(log n))で検索します。要素が見つからない場合は nil を返します。self はあらかじめソートしておく必要があります。
...rch_index { |x| x >= 4 } # => 1
ary.bsearch_index { |x| x >= 6 } # => 2
ary.bsearch_index { |x| x >= -1 } # => 0
ary.bsearch_index { |x| x >= 100 } # => nil
//}
//emlist[例: find-any モード][ruby]{
ary = [0, 4, 7, 10, 12]
# 4 <= v < 8 になる要素の位置を検索
ary.bsearch_index { |......x| 1 - x / 4 } # => 2
# 8 <= v < 10 になる要素の位置を検索
ary.bsearch_index { |x| 4 - x / 2 } # => nil
//}
@see Array#bsearch... -
Array
# bsearch _ index { |x| . . . } -> Integer | nil (6145.0) -
ブロックの評価結果で範囲内の各要素の判定を行い、条件を満たす値の位置を 二分探索(計算量は O(log n))で検索します。要素が見つからない場合は nil を返します。self はあらかじめソートしておく必要があります。
...rch_index { |x| x >= 4 } # => 1
ary.bsearch_index { |x| x >= 6 } # => 2
ary.bsearch_index { |x| x >= -1 } # => 0
ary.bsearch_index { |x| x >= 100 } # => nil
//}
//emlist[例: find-any モード][ruby]{
ary = [0, 4, 7, 10, 12]
# 4 <= v < 8 になる要素の位置を検索
ary.bsearch_index { |......x| 1 - x / 4 } # => 2
# 8 <= v < 10 になる要素の位置を検索
ary.bsearch_index { |x| 4 - x / 2 } # => nil
//}
@see Array#bsearch...