2100件ヒット
[1-100件を表示]
(0.157秒)
別のキーワード
クラス
-
ARGF
. class (12) - Array (324)
- Complex (24)
- Dir (19)
- Enumerator (163)
-
Enumerator
:: Lazy (308) - Float (24)
- Hash (168)
- IO (84)
- Integer (60)
- Matrix (86)
- Numeric (57)
- Object (63)
- Pathname (27)
- Prime (12)
-
Prime
:: PseudoPrimeGenerator (24) - Range (59)
- Rational (24)
- String (80)
- StringIO (50)
- Struct (19)
- Vector (12)
モジュール
- Enumerable (368)
- TSort (33)
キーワード
- % (14)
- + (7)
- bsearch (24)
-
bsearch
_ index (10) - bytes (7)
- chain (7)
- chunk (36)
-
chunk
_ while (12) - collect (48)
- collect! (19)
- collect2 (12)
-
collect
_ concat (12) - combination (12)
- cycle (24)
-
delete
_ if (24) - denominator (48)
- detect (12)
- downto (12)
- drop (12)
-
drop
_ while (24) - each (168)
-
each
_ byte (36) -
each
_ char (24) -
each
_ child (19) -
each
_ codepoint (12) -
each
_ cons (12) -
each
_ entry (15) -
each
_ grapheme _ cluster (8) -
each
_ index (12) -
each
_ key (12) -
each
_ line (72) -
each
_ pair (12) -
each
_ slice (12) -
each
_ strongly _ connected _ component (11) -
each
_ strongly _ connected _ component _ from (11) -
each
_ value (12) -
each
_ with _ index (36) -
each
_ with _ object (12) -
enum
_ for (24) - feed (12)
- filter (35)
- filter! (14)
-
filter
_ map (12) - find (12)
-
find
_ all (24) -
find
_ index (36) -
flat
_ map (12) - grep (12)
-
grep
_ v (10) - gsub (12)
- gsub! (12)
- index (24)
-
keep
_ if (24) - lazy (12)
- lines (7)
- map (48)
- map! (19)
-
max
_ by (24) -
min
_ by (24) -
minmax
_ by (12) - next (12)
-
next
_ values (12) - peek (12)
-
peek
_ values (12) - permutation (12)
- reject (48)
- reject! (24)
-
repeated
_ combination (12) -
repeated
_ permutation (12) -
reverse
_ each (14) - rewind (12)
- rindex (12)
- select (60)
- select! (24)
- size (12)
-
slice
_ after (46) -
slice
_ before (60) -
slice
_ when (23) -
sort
_ by (12) -
sort
_ by! (12) - step (76)
- take (12)
-
take
_ while (48) - then (7)
- times (12)
-
to
_ enum (24) -
transform
_ keys (8) -
transform
_ keys! (8) -
transform
_ values (9) -
transform
_ values! (9) -
tsort
_ each (11) - upto (12)
-
with
_ index (24) -
with
_ object (24) -
yield
_ self (8) - zip (24)
検索結果
先頭5件
-
Rational
# numerator -> Integer (24250.0) -
分子を返します。
...分子を返します。
@return 分子を返します。
//emlist[例][ruby]{
Rational(7).numerator # => 7
Rational(7, 1).numerator # => 7
Rational(9, -4).numerator # => -9
Rational(-2, -10).numerator # => 1
//}
@see Rational#denominator... -
Float
# numerator -> Integer (24238.0) -
自身を Rational に変換した時の分子を返します。
...自身を Rational に変換した時の分子を返します。
@return 分子を返します。
//emlist[例][ruby]{
2.0.numerator # => 2
0.5.numerator # => 1
//}
@see Float#denominator... -
Integer
# numerator -> Integer (24238.0) -
分子(常に自身)を返します。
...分子(常に自身)を返します。
@return 分子を返します。
//emlist[][ruby]{
10.numerator # => 10
-10.numerator # => -10
//}
@see Integer#denominator... -
Complex
# numerator -> Complex (24232.0) -
分子を返します。
...分子を返します。
//emlist[例][ruby]{
Complex('1/2+2/3i').numerator # => (3+4i)
Complex(3).numerator # => (3+0i)
//}
@see Complex#denominator... -
Enumerator
:: Lazy # filter {|item| . . . } -> Enumerator :: Lazy (9325.0) -
Enumerable#select と同じですが、配列ではなくEnumerator::Lazy を返します。
...le#select と同じですが、配列ではなくEnumerator::Lazy を返します。
@raise ArgumentError ブロックを指定しなかった場合に発生します。
//emlist[例][ruby]{
1.step.lazy.find_all { |i| i.even? }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:fi......nd_all>
1.step.lazy.select { |i| i.even? }.take(10).force
# => [2, 4, 6, 8, 10, 12, 14, 16, 18, 20]
//}
@see Enumerable#select... -
Enumerator
:: Lazy # filter _ map {|item| . . . } -> Enumerator :: Lazy (9325.0) -
Enumerable#filter_map と同じですが、配列ではなく Enumerator::Lazy を返します。
...lter_map と同じですが、配列ではなく Enumerator::Lazy を返します。
@raise ArgumentError ブロックを指定しなかった場合に発生します。
//emlist[例][ruby]{
1.step.lazy.filter_map { |n| n * 2 if n.even? }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: (1.step)>:filt......er_map>
1.step.lazy.filter_map { |n| n * 2 if n.even? }.take(10).force
# => [4, 8, 12, 16, 20, 24, 28, 32, 36, 40]
//}
@see Enumerable#filter_map... -
Enumerator
:: Lazy # slice _ after(pattern) -> Enumerator :: Lazy (9319.0) -
Enumerable#slice_after と同じですが、配列ではなく Enumerator::Lazy を返します。
...le#slice_after と同じですが、配列ではなく Enumerator::Lazy を返します。
//emlist[例][ruby]{
1.step.lazy.slice_after { |e| e % 3 == 0 }
# => #<Enumerator::Lazy: #<Enumerator: #<Enumerator::Generator:0x007fd73980e6f8>:each>>
1.step.lazy.slice_after { |e| e % 3 == 0 }.take(5).forc......e
# => [[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12], [13, 14, 15]]
//}
@see Enumerable#slice_after... -
Enumerator
# next -> object (9249.0) -
「次」のオブジェクトを返します。
...ます。
列挙が既に最後へ到達している場合は、
StopIteration 例外を発生します。このとき列挙状態は変化しません。
つまりもう一度 next を呼ぶと再び例外が発生します。
next メソッドによる外部列挙の状態は他のイテレータ......
@raise StopIteration 列挙状態が既に最後へ到達しているとき
@see Enumerator#rewind
//emlist[例1][ruby]{
str = "xyz"
enum = str.each_byte
str.bytesize.times do
puts enum.next
end
# => 120
# 121
# 122
//}
//emlist[例2][ruby]{
str = "xyz"
enum = str.each_byte......uts enum.next while true
rescue StopIteration
puts "iteration reached at end"
end
# => 120
# 121
# 122
# iteration reached at end
puts enum.next
#=> 再度 StopIteration 例外が発生
//}
//emlist[例3: Kernel.#loop は StopIteration を捕捉します。][ruby]{
st... -
Enumerator
:: Lazy # collect _ concat {|item| . . . } -> Enumerator :: Lazy (9237.0) -
ブロックの実行結果をひとつに繋げたものに対してイテレートするような Enumerator::Lazy のインスタンスを返します。
...ブロックの実行結果をひとつに繋げたものに対してイテレートするような
Enumerator::Lazy のインスタンスを返します。
//emlist[][ruby]{
["foo", "bar"].lazy.flat_map {|i| i.each_char.lazy}.force
#=> ["f", "o", "o", "b", "a", "r"]
//}
ブロックの返した......配列であるか、to_ary メソッドを持つとき
* x が each および force メソッドを持つ (例:Enumerator::Lazy) とき
それ以外のときは、x は分解されず、そのままの値として使われます。
//emlist[][ruby]{
[{a:1}, {b:2}].lazy.flat_map {|i| i}.force
#......=> [{:a=>1}, {:b=>2}]
//}
@raise ArgumentError ブロックを指定しなかった場合に発生します。
@see Enumerable#flat_map... -
Enumerator
:: Lazy # flat _ map {|item| . . . } -> Enumerator :: Lazy (9237.0) -
ブロックの実行結果をひとつに繋げたものに対してイテレートするような Enumerator::Lazy のインスタンスを返します。
...ブロックの実行結果をひとつに繋げたものに対してイテレートするような
Enumerator::Lazy のインスタンスを返します。
//emlist[][ruby]{
["foo", "bar"].lazy.flat_map {|i| i.each_char.lazy}.force
#=> ["f", "o", "o", "b", "a", "r"]
//}
ブロックの返した......配列であるか、to_ary メソッドを持つとき
* x が each および force メソッドを持つ (例:Enumerator::Lazy) とき
それ以外のときは、x は分解されず、そのままの値として使われます。
//emlist[][ruby]{
[{a:1}, {b:2}].lazy.flat_map {|i| i}.force
#......=> [{:a=>1}, {:b=>2}]
//}
@raise ArgumentError ブロックを指定しなかった場合に発生します。
@see Enumerable#flat_map...