2190件ヒット
[801-900件を表示]
(0.078秒)
別のキーワード
ライブラリ
- ビルトイン (2154)
- abbrev (12)
- csv (12)
- shellwords (12)
キーワード
- & (12)
- * (24)
- + (12)
- - (12)
- << (12)
- <=> (12)
- == (12)
- [] (36)
- []= (36)
- abbrev (12)
- all? (21)
- any? (30)
- append (8)
- assoc (12)
- at (12)
- bsearch (24)
-
bsearch
_ index (20) - clear (12)
- clone (12)
- collect (24)
- collect! (24)
- combination (24)
- compact (12)
- compact! (12)
- concat (21)
- count (36)
- cycle (24)
- delete (24)
-
delete
_ at (12) -
delete
_ if (24) - difference (7)
- dig (10)
- drop (12)
-
drop
_ while (24) - dup (12)
- each (24)
-
each
_ index (24) - empty? (12)
- eql? (12)
- fetch (36)
- fill (72)
- filter (14)
- filter! (14)
-
find
_ index (36) - first (24)
- flatten (12)
- flatten! (12)
- hash (12)
- include? (12)
- index (36)
- insert (12)
- inspect (12)
- intersect? (4)
- intersection (6)
- join (12)
-
keep
_ if (24) - last (24)
- length (12)
- map (24)
- map! (24)
- max (36)
- min (36)
- minmax (12)
- none? (21)
- one? (21)
- pack (21)
- permutation (24)
- pop (24)
- prepend (8)
- product (24)
- push (12)
- rassoc (12)
- reject (24)
- reject! (24)
-
repeated
_ combination (24) -
repeated
_ permutation (24) - replace (12)
- reverse (12)
- reverse! (12)
-
reverse
_ each (24) - rindex (36)
- rotate (12)
- rotate! (12)
- sample (48)
- select (24)
- select! (24)
- shelljoin (12)
- shift (24)
- shuffle (24)
- shuffle! (24)
- size (12)
- slice (36)
- slice! (36)
- sort (24)
- sort! (24)
-
sort
_ by! (24) - sum (18)
- take (12)
-
take
_ while (24) -
to
_ a (12) -
to
_ ary (12) -
to
_ csv (12) -
to
_ h (19) -
to
_ s (12) - transpose (12)
- union (7)
- uniq (24)
- uniq! (24)
- unshift (12)
-
values
_ at (12) - zip (24)
- | (12)
検索結果
先頭5件
-
Array
# combination(n) {|c| block } -> self (9014.0) -
サイズ n の組み合わせをすべて生成し、それを引数としてブロックを実行します。
...た配列の各要素を引数としてブロックを実
行して self を返します。
//emlist[例][ruby]{
a = [1, 2, 3, 4]
result = []
a.combination(2) {|e| result << e} # => [1,2,3,4]
result #=> [[1,2],[1,3],[1,4],[2,3],[2,4],[3,4]]
//}
@see Array#permutation, Array#repeated_combination... -
Array
# delete _ if -> Enumerator (9014.0) -
要素を順番にブロックに渡して評価し、その結果が真になった要素をすべて削除します。 delete_if は常に self を返しますが、reject! は要素が 1 つ以上削除されれば self を、 1 つも削除されなければ nil を返します。
...い。
//emlist[例][ruby]{
a = [0, 1, 2, 3, 4, 5]
a.delete_if{|x| x % 2 == 0}
p a #=> [1, 3, 5]
a = [0, 1, 2, 3, 4, 5]
e = a.reject!
e.each{|i| i % 2 == 0}
p a #=> [1, 3, 5] もとの配列から削除されていることに注意。
//}
@see Array#select!, Array#keep_if... -
Array
# delete _ if {|x| . . . } -> self (9014.0) -
要素を順番にブロックに渡して評価し、その結果が真になった要素をすべて削除します。 delete_if は常に self を返しますが、reject! は要素が 1 つ以上削除されれば self を、 1 つも削除されなければ nil を返します。
...い。
//emlist[例][ruby]{
a = [0, 1, 2, 3, 4, 5]
a.delete_if{|x| x % 2 == 0}
p a #=> [1, 3, 5]
a = [0, 1, 2, 3, 4, 5]
e = a.reject!
e.each{|i| i % 2 == 0}
p a #=> [1, 3, 5] もとの配列から削除されていることに注意。
//}
@see Array#select!, Array#keep_if... -
Array
# each -> Enumerator (9014.0) -
各要素に対してブロックを評価します。
...してブロックを評価します。
ブロックが与えられなかった場合は、自身と each から生成した
Enumerator オブジェクトを返します。
//emlist[例][ruby]{
[1, 2, 3].each do |i|
puts i
end
#=> 1
# 2
# 3
//}
@see Array#each_index, Array#reverse_each... -
Array
# each {|item| . . . . } -> self (9014.0) -
各要素に対してブロックを評価します。
...してブロックを評価します。
ブロックが与えられなかった場合は、自身と each から生成した
Enumerator オブジェクトを返します。
//emlist[例][ruby]{
[1, 2, 3].each do |i|
puts i
end
#=> 1
# 2
# 3
//}
@see Array#each_index, Array#reverse_each... -
Array
# each _ index -> Enumerator (9014.0) -
各要素のインデックスに対してブロックを評価します。
...を評価します。
以下と同じです。
//emlist[例][ruby]{
(0 ... ary.size).each do |index|
# ....
end
//}
ブロックが与えられなかった場合は、自身と each_index から生成した
Enumerator オブジェクトを返します。
@see Array#each, Array#reverse_each... -
Array
# each _ index {|index| . . . . } -> self (9014.0) -
各要素のインデックスに対してブロックを評価します。
...を評価します。
以下と同じです。
//emlist[例][ruby]{
(0 ... ary.size).each do |index|
# ....
end
//}
ブロックが与えられなかった場合は、自身と each_index から生成した
Enumerator オブジェクトを返します。
@see Array#each, Array#reverse_each... -
Array
# fetch(nth) -> object (9014.0) -
nth 番目の要素を返します。
...nth 番目の要素を返します。
Array#[] (nth) とは nth 番目の要素が存在しない場合の振舞いが異
なります。最初の形式では、例外 IndexError が発生します。
二番目の形式では、引数 ifnone を返します。
三番目の形式では、ブロッ......しなかった場合に発生します。
//emlist[例][ruby]{
a = [1, 2, 3, 4, 5]
begin
p a.fetch(10)
rescue IndexError => err
puts err #=> index 10 out of array
end
p a.fetch(10, 999) #=> 999
result = a.fetch(10){|nth|
print "#{nth} はありません。\n"
999
}
p result #=> 999
//}... -
Array
# fetch(nth) {|nth| . . . } -> object (9014.0) -
nth 番目の要素を返します。
...nth 番目の要素を返します。
Array#[] (nth) とは nth 番目の要素が存在しない場合の振舞いが異
なります。最初の形式では、例外 IndexError が発生します。
二番目の形式では、引数 ifnone を返します。
三番目の形式では、ブロッ......しなかった場合に発生します。
//emlist[例][ruby]{
a = [1, 2, 3, 4, 5]
begin
p a.fetch(10)
rescue IndexError => err
puts err #=> index 10 out of array
end
p a.fetch(10, 999) #=> 999
result = a.fetch(10){|nth|
print "#{nth} はありません。\n"
999
}
p result #=> 999
//}...