ライブラリ
- ビルトイン (627)
- csv (176)
- dbm (11)
- gdbm (11)
- matrix (122)
-
net
/ http (649) - prime (44)
- psych (11)
-
rdoc
/ generator / json _ index (11) -
rexml
/ document (132) -
rubygems
/ commands / dependency _ command (11) -
rubygems
/ indexer (165) -
rubygems
/ source _ index (231) -
rubygems
/ source _ info _ cache _ entry (22) - sdbm (11)
- socket (22)
- strscan (22)
-
yaml
/ dbm (11)
クラス
- Array (278)
- CSV (33)
-
CSV
:: FieldInfo (22) -
CSV
:: Row (66) -
CSV
:: Table (55) - DBM (11)
- Enumerator (22)
-
Enumerator
:: Lazy (10) - GDBM (11)
-
Gem
:: Commands :: DependencyCommand (11) -
Gem
:: Indexer (165) -
Gem
:: SourceIndex (231) -
Gem
:: SourceInfoCacheEntry (22) - Hash (138)
- MatchData (33)
- Matrix (110)
-
Net
:: HTTP (132) -
Net
:: HTTPGenericRequest (88) -
Net
:: HTTPResponse (99) -
Prime
:: PseudoPrimeGenerator (44) -
Psych
:: Parser :: Mark (11) -
RDoc
:: Generator :: JsonIndex (11) -
REXML
:: Elements (33) -
REXML
:: Parent (88) - Regexp (11)
-
RubyVM
:: InstructionSequence (11) - SDBM (11)
-
Socket
:: AncillaryData (11) -
Socket
:: Ifaddr (11) - String (52)
- StringScanner (22)
- Vector (12)
-
YAML
:: DBM (11)
モジュール
- Enumerable (72)
-
Net
:: HTTPHeader (330) -
REXML
:: Node (11)
キーワード
- [] (77)
- []= (100)
- abbreviate (11)
-
add
_ spec (11) -
add
_ specs (11) -
basic
_ auth (11) - begin (11)
- body (22)
- body= (11)
-
body
_ stream (11) -
body
_ stream= (11) - bsearch (18)
-
bsearch
_ index (18) -
build
_ indices (9) -
build
_ indicies (2) - byteindex (2)
- byterindex (2)
- bytesplice (4)
- chunked? (11)
- code (11)
-
collect
_ specs (11) -
compact
_ specs (11) - compress (11)
-
content
_ length (11) -
content
_ length= (11) -
content
_ range (11) -
content
_ type= (11) - convert (33)
- delete (33)
-
delete
_ at (11) -
dest
_ directory (11) - directory (11)
- dump (11)
- each (77)
-
each
_ capitalized _ name (11) -
each
_ header (11) -
each
_ index (44) -
each
_ key (11) -
each
_ name (11) -
each
_ value (11) -
each
_ with _ index (66) - end (11)
- entity (11)
- fetch (66)
- field (11)
- fill (66)
- filter! (12)
-
find
_ gems (11) -
find
_ index (99) -
find
_ name (11) -
form
_ data= (11) -
gem
_ file _ list (11) -
gem
_ signature (11) - generate (11)
-
generate
_ index (11) - get (22)
- get2 (22)
-
get
_ fields (11) - getbyte (11)
- gzip (11)
- head (11)
- head2 (22)
-
http
_ version (11) - ifindex (11)
- index= (11)
-
index
_ in _ parent (11) -
index
_ signature (11) -
install
_ indices (9) -
install
_ indicies (2) -
ipv6
_ pktinfo _ ifindex (11) -
keep
_ if (22) - key (7)
- key? (11)
-
latest
_ specs (11) - length (11)
-
load
_ gems _ in (11) -
main
_ type (11) -
make
_ temp _ directories (11) - method (22)
- msg (11)
-
named
_ captures (11) - outdated (11)
- paranoid (11)
- path (11)
- pointer= (11)
- pos= (11)
-
proxy
_ basic _ auth (11) - range (11)
-
range
_ length (11) -
read
_ body (22) - refresh (11)
- refresh! (11)
-
remove
_ spec (11) -
request
_ body _ permitted? (11) -
request
_ get (22) -
request
_ head (22) -
response
_ body _ permitted? (11) - rindex (44)
- sanitize (11)
-
sanitize
_ string (11) - search (11)
- select! (22)
-
send
_ request (11) -
set
_ content _ type (11) -
set
_ form _ data (11) - setbyte (11)
- size (22)
-
source
_ index (11) -
spec
_ dirs (11) -
spec
_ dirs= (11) - specification (11)
-
sub
_ type (11) -
to
_ a (11) -
to
_ h (17) -
transform
_ keys (18) -
transform
_ keys! (18) -
transform
_ values (16) -
transform
_ values! (16) -
type
_ params (11) - update (11)
- value (11)
-
values
_ at (11) -
with
_ index (54)
検索結果
先頭5件
-
CSV
:: Row # index(header , minimum _ index = 0) -> Integer (18221.0) -
与えられたヘッダの名前に対応するインデックスを返します。
...aram minimum_index このインデックスより後で、ヘッダの名前を探します。
重複しているヘッダがある場合に便利です。
//emlist[例][ruby]{
require "csv"
row = CSV::Row.new(["header1", "header2", "header1"], [1, 2, 3])
row.index("header1")......# => 0
row.index("header1", 1) # => 2
//}
@see CSV::Row#field... -
String
# index(pattern , pos = 0) -> Integer | nil (18132.0) -
文字列のインデックス pos から右に向かって pattern を検索し、 最初に見つかった部分文字列の左端のインデックスを返します。 見つからなければ nil を返します。
...ンデックス
//emlist[例][ruby]{
p "astrochemistry".index("str") # => 1
p "regexpindex".index(/e.*x/, 2) # => 3
p "character".index(?c) # => 0
p "foobarfoobar".index("bar", 6) # => 9
p "foobarfoobar".index("bar", -6) # => 9
//}
@see String#rindex......mlist[例][ruby]{
p "astrochemistry".index("str") # => 1
p "regexpindex".index(/e.*x/, 2) # => 3
p "character".index(?c) # => 0
p "foobarfoobar".index("bar", 6) # => 9
p "foobarfoobar".index("bar", -6) # => 9
//}
@see String#rindex
@see String#byteindex... -
Array
# index -> Enumerator (18131.0) -
条件に一致する最初の要素の位置を返します。
...しい要素がひとつもなかった場合は nil を返します。
//emlist[例][ruby]{
p [1, 0, 0, 1, 0].index(1) #=> 0
p [1, 0, 0, 0, 0].index(1) #=> 0
p [0, 0, 0, 0, 0].index(1) #=> nil
//}
ブロックが与えられた場合には、各要素を引数として順にブロックを......返します。
一つも真にならなかった場合は nil を返します。
//emlist[例][ruby]{
p [0, 1, 0, 1, 0].index {|v| v > 0} #=> 1
//}
引数、ブロックのどちらも与えられなかった場合は、
Enumerator のインスタンスを返します。
@see Array#rindex... -
Array
# index {|item| . . . } -> Integer | nil (18131.0) -
条件に一致する最初の要素の位置を返します。
...しい要素がひとつもなかった場合は nil を返します。
//emlist[例][ruby]{
p [1, 0, 0, 1, 0].index(1) #=> 0
p [1, 0, 0, 0, 0].index(1) #=> 0
p [0, 0, 0, 0, 0].index(1) #=> nil
//}
ブロックが与えられた場合には、各要素を引数として順にブロックを......返します。
一つも真にならなかった場合は nil を返します。
//emlist[例][ruby]{
p [0, 1, 0, 1, 0].index {|v| v > 0} #=> 1
//}
引数、ブロックのどちらも与えられなかった場合は、
Enumerator のインスタンスを返します。
@see Array#rindex... -
Array
# index(val) -> Integer | nil (18131.0) -
条件に一致する最初の要素の位置を返します。
...しい要素がひとつもなかった場合は nil を返します。
//emlist[例][ruby]{
p [1, 0, 0, 1, 0].index(1) #=> 0
p [1, 0, 0, 0, 0].index(1) #=> 0
p [0, 0, 0, 0, 0].index(1) #=> nil
//}
ブロックが与えられた場合には、各要素を引数として順にブロックを......返します。
一つも真にならなかった場合は nil を返します。
//emlist[例][ruby]{
p [0, 1, 0, 1, 0].index {|v| v > 0} #=> 1
//}
引数、ブロックのどちらも与えられなかった場合は、
Enumerator のインスタンスを返します。
@see Array#rindex... -
Matrix
# index(selector = :all) -> Enumerator (18119.0) -
指定した値と一致する要素の位置を [row, column] という配列で返します。 ブロックを与えた場合は各要素を引数としてブロックを呼び出し、 返り値が真であった要素の位置を返します。
...数の意味は
Matrix#each を参照してください。
//emlist[例][ruby]{
require 'matrix'
Matrix[ [1,2], [3,4] ].index(&:even?) # => [0, 1]
Matrix[ [1,1], [1,1] ].index(1, :strict_lower) # => [1, 0]
//}
value を指定せず、さらにブロックを省略した場合、
Enumerator を返... -
Matrix
# index(selector = :all) {|e| . . . } -> [Integer , Integer] | nil (18119.0) -
指定した値と一致する要素の位置を [row, column] という配列で返します。 ブロックを与えた場合は各要素を引数としてブロックを呼び出し、 返り値が真であった要素の位置を返します。
...数の意味は
Matrix#each を参照してください。
//emlist[例][ruby]{
require 'matrix'
Matrix[ [1,2], [3,4] ].index(&:even?) # => [0, 1]
Matrix[ [1,1], [1,1] ].index(1, :strict_lower) # => [1, 0]
//}
value を指定せず、さらにブロックを省略した場合、
Enumerator を返... -
Matrix
# index(value , selector = :all) -> [Integer , Integer] | nil (18119.0) -
指定した値と一致する要素の位置を [row, column] という配列で返します。 ブロックを与えた場合は各要素を引数としてブロックを呼び出し、 返り値が真であった要素の位置を返します。
...数の意味は
Matrix#each を参照してください。
//emlist[例][ruby]{
require 'matrix'
Matrix[ [1,2], [3,4] ].index(&:even?) # => [0, 1]
Matrix[ [1,1], [1,1] ].index(1, :strict_lower) # => [1, 0]
//}
value を指定せず、さらにブロックを省略した場合、
Enumerator を返... -
CSV
:: FieldInfo # index -> Integer (18108.0) -
行内で何番目のフィールドかわかるゼロベースのインデックスを返します。
...list[例][ruby]{
require 'csv'
csv = CSV.new("date1,date2\n2018-07-09,2018-07-10", headers: true)
csv.convert do |field,field_info|
p field_info.index
Date.parse(field)
end
p csv.first
# => 0
# => 1
# => #<CSV::Row "date1":#<Date: 2018-07-09 ((2458309j,0s,0n),+0s,2299161j)> "date2":#<Date: 201... -
Hash
# index(val) -> object (18108.0) -
値 val に対応するキーを返します。対応する要素が存在しない時には nil を返します。
...存在しない時には
nil を返します。
該当するキーが複数存在する場合、どのキーを返すかは不定です。
Hash#index は obsolete です。
使用すると警告メッセージが表示されます。
@param val 探索に用いる値を指定します。
//emlist...