1381件ヒット
[1-100件を表示]
(0.137秒)
ライブラリ
- ビルトイン (397)
- csv (66)
- matrix (44)
-
net
/ http (561) - prime (44)
- psych (11)
-
rdoc
/ generator / json _ index (11) - readline (33)
-
rexml
/ document (55) -
rubygems
/ commands / dependency _ command (11) -
rubygems
/ source _ index (44) -
rubygems
/ source _ info _ cache _ entry (22) -
webrick
/ config (11) -
webrick
/ httputils (11) - win32ole (11)
クラス
- Array (135)
-
CSV
:: Row (44) -
CSV
:: Table (22) - Enumerator (22)
-
Enumerator
:: Lazy (10) -
Gem
:: Commands :: DependencyCommand (11) -
Gem
:: SourceIndex (44) -
Gem
:: SourceInfoCacheEntry (22) - Hash (136)
- MatchData (33)
- Matrix (44)
-
Net
:: HTTP (143) -
Net
:: HTTPGenericRequest (33) -
Net
:: HTTPResponse (55) -
Prime
:: PseudoPrimeGenerator (44) -
Psych
:: Parser :: Mark (11) -
RDoc
:: Generator :: JsonIndex (11) -
REXML
:: Parent (55) -
RubyVM
:: InstructionSequence (11) -
WIN32OLE
_ PARAM (11)
モジュール
- Enumerable (39)
-
Net
:: HTTPHeader (330) -
WEBrick
:: Config (11) -
WEBrick
:: HTTPUtils (11)
オブジェクト
-
Readline
:: HISTORY (33)
キーワード
- FileHandler (11)
-
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 2
. 7 . 0 (5) -
SEARCH
_ INDEX _ FILE (11) - String (11)
- [] (55)
- []= (22)
-
add
_ specs (11) -
basic
_ auth (11) - begin (11)
-
body
_ stream (11) -
body
_ stream= (11) - bsearch (18)
-
bsearch
_ index (18) - chunked? (11)
-
content
_ length (11) -
content
_ length= (11) -
content
_ range (11) -
content
_ type= (11) - delete (33)
-
delete
_ at (22) - 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)
- fetch (66)
- field (11)
- fill (22)
- filter! (12)
-
find
_ gems (11) -
form
_ data= (11) - get (22)
- get2 (22)
-
get
_ fields (11) -
get
_ print (11) - head (11)
- head2 (22)
-
keep
_ if (22) - key (7)
- key? (11)
-
main
_ type (11) - method (11)
-
mime
_ type (11) - msg (11)
- new (11)
- path (11)
-
proxy
_ basic _ auth (11) - range (11)
-
range
_ length (11) -
read
_ body (22) - refresh (11)
-
request
_ get (22) -
request
_ head (22) -
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 4 feature (11) -
rubygems
/ commands / generate _ index _ command (11) - search (11)
- select! (22)
-
send
_ request (11) -
set
_ content _ type (11) -
set
_ form _ data (11) -
source
_ index (11) -
sub
_ type (11) -
to
_ a (11) -
to
_ h (17) -
transform
_ keys (17) -
transform
_ keys! (17) -
transform
_ values (16) -
transform
_ values! (16) -
type
_ params (11) - value (11)
-
values
_ at (11) -
with
_ index (54)
検索結果
先頭5件
-
Psych
:: Parser :: Mark # index -> Integer (27201.0) -
先頭からの文字数。
先頭からの文字数。 -
Enumerable
# each _ with _ index(*args) {|item , index| . . . } -> self (24633.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 (24630.0) -
与えられたブロックに対して、素数を0起点の連番を渡して評価します。
...を返します。 ブロックを与えられなかった場合は 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... -
Enumerable
# each _ with _ index(*args) -> Enumerator (24533.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 -> Enumerator (24530.0) -
与えられたブロックに対して、素数を0起点の連番を渡して評価します。
...を返します。 ブロックを与えられなかった場合は 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... -
Matrix
# each _ with _ index(which = :all) -> Enumerator (24508.0) -
行列の各要素をその位置とともに引数としてブロックを呼び出します。
...which で処理する要素の範囲を指定することができます。
Matrix#each と同じなのでそちらを参照してください。
ブロックを省略した場合、 Enumerator を返します。
//emlist[例][ruby]{
require 'matrix'
Matrix[ [1,2], [3,4] ].each_with_index do |e,......row, col|
puts "#{e} at #{row}, #{col}"
end
# => 1 at 0, 0
# => 2 at 0, 1
# => 3 at 1, 0
# => 4 at 1, 1
//}
@param which どの要素に対してブロックを呼び出すのかを Symbol で指定します
@see Matrix#each... -
Matrix
# each _ with _ index(which = :all) {|e , row , col| . . . } -> self (24508.0) -
行列の各要素をその位置とともに引数としてブロックを呼び出します。
...which で処理する要素の範囲を指定することができます。
Matrix#each と同じなのでそちらを参照してください。
ブロックを省略した場合、 Enumerator を返します。
//emlist[例][ruby]{
require 'matrix'
Matrix[ [1,2], [3,4] ].each_with_index do |e,......row, col|
puts "#{e} at #{row}, #{col}"
end
# => 1 at 0, 0
# => 2 at 0, 1
# => 3 at 1, 0
# => 4 at 1, 1
//}
@param which どの要素に対してブロックを呼び出すのかを Symbol で指定します
@see Matrix#each... -
Hash
# index(val) -> object (24331.0) -
値 val に対応するキーを返します。対応する要素が存在しない時には nil を返します。
...値 val に対応するキーを返します。対応する要素が存在しない時には
nil を返します。
該当するキーが複数存在する場合、どのキーを返すかは不定です。
Hash#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 Hash#invert... -
Array
# bsearch _ index -> Enumerator (21468.0) -
ブロックの評価結果で範囲内の各要素の判定を行い、条件を満たす値の位置を 二分探索(計算量は O(log n))で検索します。要素が見つからない場合は nil を返します。self はあらかじめソートしておく必要があります。
...ソッドはArray#bsearchと同様に、ブロックを評価した結果により2
つのモードで動作します。Array#bsearch との違いは見つかった要素自
身を返すか位置を返すかのみです。各モードのより詳細な違いについては
Array#bsearch を参照し......emlist[例: find-minimum モード][ruby]{
ary = [0, 4, 7, 10, 12]
ary.bsearch_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, 1......0, 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 (21468.0) -
ブロックの評価結果で範囲内の各要素の判定を行い、条件を満たす値の位置を 二分探索(計算量は O(log n))で検索します。要素が見つからない場合は nil を返します。self はあらかじめソートしておく必要があります。
...ソッドはArray#bsearchと同様に、ブロックを評価した結果により2
つのモードで動作します。Array#bsearch との違いは見つかった要素自
身を返すか位置を返すかのみです。各モードのより詳細な違いについては
Array#bsearch を参照し......emlist[例: find-minimum モード][ruby]{
ary = [0, 4, 7, 10, 12]
ary.bsearch_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, 1......0, 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...