別のキーワード
クラス
- Array (306)
-
CSV
:: FieldInfo (12) -
CSV
:: Row (48) -
CSV
:: Table (48) - Enumerator (24)
-
Enumerator
:: Lazy (12) - Hash (152)
- MatchData (40)
- Matrix (120)
-
Net
:: HTTP (144) -
Net
:: HTTPGenericRequest (72) -
Net
:: HTTPResponse (108) -
Prime
:: PseudoPrimeGenerator (48) -
REXML
:: Elements (12) - Regexp (12)
-
RubyVM
:: InstructionSequence (12) - String (54)
モジュール
- Enumerable (79)
-
Net
:: HTTPHeader (300)
キーワード
- [] (72)
-
basic
_ auth (12) - begin (12)
- body (24)
-
body
_ stream (12) - bsearch (20)
-
bsearch
_ index (20) - bytebegin (2)
- byteend (2)
- byteindex (3)
- byterindex (3)
- chunked? (12)
- code (12)
-
content
_ length (12) -
content
_ range (12) - delete (36)
- each (60)
-
each
_ capitalized _ name (12) -
each
_ header (12) -
each
_ index (24) -
each
_ key (12) -
each
_ name (12) -
each
_ value (12) -
each
_ with _ index (72) - end (12)
- entity (12)
- fetch (72)
-
fetch
_ values (2) - field (12)
- fill (72)
- filter! (14)
-
find
_ index (108) - get (24)
- get2 (24)
-
get
_ fields (12) - getbyte (12)
- head (12)
- head2 (24)
-
http
_ version (12) -
keep
_ if (24) - key (7)
- key? (12)
-
main
_ type (12) - method (24)
- msg (12)
-
named
_ captures (12) - path (12)
-
proxy
_ basic _ auth (12) - range (12)
-
range
_ length (12) -
read
_ body (24) -
request
_ body _ permitted? (12) -
request
_ get (24) -
request
_ head (24) -
response
_ body _ permitted? (12) - rindex (48)
- select! (24)
-
send
_ request (12) -
set
_ form _ data (12) - setbyte (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) - value (12)
-
values
_ at (12) -
with
_ index (60)
検索結果
先頭5件
-
RubyVM
:: InstructionSequence # to _ a -> Array (26143.0) -
self の情報を 14 要素の配列にして返します。
...シーケンスのラ
ベル。トップレベルでは "<main>"。文字列から作成していた場合は
"<compiled>"。
: #path
命令シーケンスの相対パス。文字列から作成していた場合は "<compiled>"。
: #absolute_path
命令シーケンスの絶対パス。......引数の個数。あるいは以下のよう
な配列。
[required_argc, [optional_arg_labels, ...],
splat_index, post_splat_argc, post_splat_index,
block_index, simple]
より詳細な情報については、vm_core.h を参照。
: catch_table
例外や制御構造のオ......//emlist[例][ruby]{
require 'pp'
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
pp iseq.to_a
# ※ Ruby 2.5.0 での実行結果
# => ["YARVInstructionSequence/SimpleDataFormat",
# 2,
# 0,
# 1,
# {:arg_size=>0, :local_size=>2, :stack_max=>2},
# "<compiled>",
# "<compiled>",
# nil,
# 1,... -
CSV
:: Row # index(header , minimum _ index = 0) -> Integer (18333.0) -
与えられたヘッダの名前に対応するインデックスを返します。
...um_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... -
Array
# index -> Enumerator (18261.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 (18261.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 (18261.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... -
String
# index(pattern , pos = 0) -> Integer | nil (18244.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... -
Matrix
# index(selector = :all) -> Enumerator (18231.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 を指定せず、さらにブロックを省略した場合、
Enumer... -
Matrix
# index(selector = :all) {|e| . . . } -> [Integer , Integer] | nil (18231.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 を指定せず、さらにブロックを省略した場合、
Enumer... -
Matrix
# index(value , selector = :all) -> [Integer , Integer] | nil (18231.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 を指定せず、さらにブロックを省略した場合、
Enumer...