ライブラリ
- ビルトイン (695)
- csv (192)
- dbm (12)
- gdbm (12)
- matrix (134)
-
net
/ http (708) - prime (48)
- psych (12)
-
rdoc
/ generator / json _ index (12) -
rexml
/ document (144) -
rubygems
/ commands / dependency _ command (12) -
rubygems
/ indexer (180) -
rubygems
/ source _ index (252) -
rubygems
/ source _ info _ cache _ entry (24) - sdbm (12)
- socket (24)
- strscan (24)
-
yaml
/ dbm (12)
クラス
- Array (304)
- CSV (36)
-
CSV
:: FieldInfo (24) -
CSV
:: Row (72) -
CSV
:: Table (60) - DBM (12)
- Enumerator (24)
-
Enumerator
:: Lazy (12) - GDBM (12)
-
Gem
:: Commands :: DependencyCommand (12) -
Gem
:: Indexer (180) -
Gem
:: SourceIndex (252) -
Gem
:: SourceInfoCacheEntry (24) - Hash (152)
- MatchData (36)
- Matrix (120)
-
Net
:: HTTP (144) -
Net
:: HTTPGenericRequest (96) -
Net
:: HTTPResponse (108) -
Prime
:: PseudoPrimeGenerator (48) -
Psych
:: Parser :: Mark (12) -
RDoc
:: Generator :: JsonIndex (12) -
REXML
:: Elements (36) -
REXML
:: Parent (96) - Regexp (12)
-
RubyVM
:: InstructionSequence (12) - SDBM (12)
-
Socket
:: AncillaryData (12) -
Socket
:: Ifaddr (12) - String (64)
- StringScanner (24)
- Vector (14)
-
YAML
:: DBM (12)
モジュール
- Enumerable (79)
-
Net
:: HTTPHeader (360) -
REXML
:: Node (12)
キーワード
- [] (84)
- []= (110)
- abbreviate (12)
-
add
_ spec (12) -
add
_ specs (12) -
basic
_ auth (12) - begin (12)
- body (24)
- body= (12)
-
body
_ stream (12) -
body
_ stream= (12) - bsearch (20)
-
bsearch
_ index (20) -
build
_ indices (10) -
build
_ indicies (2) - byteindex (3)
- byterindex (3)
- bytesplice (10)
- chunked? (12)
- code (12)
-
collect
_ specs (12) -
compact
_ specs (12) - compress (12)
-
content
_ length (12) -
content
_ length= (12) -
content
_ range (12) -
content
_ type= (12) - convert (36)
- delete (36)
-
delete
_ at (12) -
dest
_ directory (12) - directory (12)
- dump (12)
- each (84)
-
each
_ capitalized _ name (12) -
each
_ header (12) -
each
_ index (48) -
each
_ key (12) -
each
_ name (12) -
each
_ value (12) -
each
_ with _ index (72) - end (12)
- entity (12)
- fetch (72)
- field (12)
- fill (72)
- filter! (14)
-
find
_ gems (12) -
find
_ index (108) -
find
_ name (12) -
form
_ data= (12) -
gem
_ file _ list (12) -
gem
_ signature (12) - generate (12)
-
generate
_ index (12) - get (24)
- get2 (24)
-
get
_ fields (12) - getbyte (12)
- gzip (12)
- head (12)
- head2 (24)
-
http
_ version (12) - ifindex (12)
- index= (12)
-
index
_ in _ parent (12) -
index
_ signature (12) -
install
_ indices (10) -
install
_ indicies (2) -
ipv6
_ pktinfo _ ifindex (12) -
keep
_ if (24) - key (7)
- key? (12)
-
latest
_ specs (12) - length (12)
-
load
_ gems _ in (12) -
main
_ type (12) -
make
_ temp _ directories (12) - method (24)
- msg (12)
-
named
_ captures (12) - outdated (12)
- paranoid (12)
- path (12)
- pointer= (12)
- pos= (12)
-
proxy
_ basic _ auth (12) - range (12)
-
range
_ length (12) -
read
_ body (24) - refresh (12)
- refresh! (12)
-
remove
_ spec (12) -
request
_ body _ permitted? (12) -
request
_ get (24) -
request
_ head (24) -
response
_ body _ permitted? (12) - rindex (48)
- sanitize (12)
-
sanitize
_ string (12) - search (12)
- select! (24)
-
send
_ request (12) -
set
_ content _ type (12) -
set
_ form _ data (12) - setbyte (12)
- size (24)
-
source
_ index (12) -
spec
_ dirs (12) -
spec
_ dirs= (12) - specification (12)
-
sub
_ type (12) -
to
_ a (12) -
to
_ h (19) -
transform
_ keys (20) -
transform
_ keys! (20) -
transform
_ values (18) -
transform
_ values! (18) -
type
_ params (12) - update (12)
- value (12)
-
values
_ at (12) -
with
_ index (60)
検索結果
先頭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...