1907件ヒット
[1-100件を表示]
(0.050秒)
クラス
-
ARGF
. class (87) - Array (296)
- Complex (22)
- Dir (17)
- Enumerator (149)
-
Enumerator
:: ArithmeticSequence (60) -
Enumerator
:: Lazy (288) - Float (22)
- Hash (152)
- IO (130)
- Integer (55)
- Numeric (73)
- Object (57)
- Range (51)
- Rational (22)
- String (73)
- Struct (17)
モジュール
- Enumerable (336)
キーワード
- % (12)
- + (6)
- == (6)
- begin (6)
- bsearch (22)
-
bsearch
_ index (9) - bytes (7)
- chain (6)
- chars (7)
- chunk (33)
-
chunk
_ while (19) - codepoints (7)
- collect (33)
- collect! (11)
-
collect
_ concat (11) - combination (11)
- cycle (22)
-
delete
_ if (22) - denominator (55)
- detect (11)
- downto (11)
- drop (11)
-
drop
_ while (22) - each (155)
-
each
_ byte (33) -
each
_ char (33) -
each
_ child (6) -
each
_ codepoint (11) -
each
_ cons (11) -
each
_ entry (11) -
each
_ grapheme _ cluster (7) -
each
_ index (11) -
each
_ key (11) -
each
_ line (66) -
each
_ pair (11) -
each
_ slice (11) -
each
_ value (11) -
each
_ with _ index (11) -
each
_ with _ object (11) - end (6)
-
enum
_ for (22) - feed (11)
- filter (30)
- filter! (12)
-
filter
_ map (10) - find (11)
-
find
_ all (22) -
find
_ index (22) - first (12)
-
flat
_ map (11) - grep (11)
-
grep
_ v (9) - gsub (11)
- gsub! (11)
- index (11)
-
keep
_ if (22) - last (12)
- lazy (11)
- lines (42)
- map (33)
- map! (11)
-
max
_ by (22) -
min
_ by (22) -
minmax
_ by (11) - next (11)
-
next
_ values (11) - peek (11)
-
peek
_ values (11) - permutation (11)
- reject (44)
- reject! (22)
-
repeated
_ combination (11) -
repeated
_ permutation (11) -
reverse
_ each (11) - rewind (11)
- rindex (11)
- select (55)
- select! (22)
- size (17)
-
slice
_ after (42) -
slice
_ before (55) -
slice
_ when (21) -
sort
_ by (11) -
sort
_ by! (11) - step (68)
- take (11)
-
take
_ while (44) - then (6)
- times (11)
-
to
_ enum (22) -
transform
_ keys (7) -
transform
_ keys! (7) -
transform
_ values (8) -
transform
_ values! (8) - upto (11)
-
with
_ index (10) -
with
_ object (22) -
yield
_ self (7) - zip (22)
検索結果
先頭5件
-
Numeric
# numerator -> Integer (18140.0) -
自身を Rational に変換した時の分子を返します。
...自身を Rational に変換した時の分子を返します。
@return 分子を返します。
@see Numeric#denominator、Integer#numerator、Float#numerator、Rational#numerator、Complex#numerator... -
Rational
# numerator -> Integer (18140.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 (18128.0) -
自身を Rational に変換した時の分子を返します。
...自身を Rational に変換した時の分子を返します。
@return 分子を返します。
//emlist[例][ruby]{
2.0.numerator # => 2
0.5.numerator # => 1
//}
@see Float#denominator... -
Integer
# numerator -> Integer (18128.0) -
分子(常に自身)を返します。
...分子(常に自身)を返します。
@return 分子を返します。
//emlist[][ruby]{
10.numerator # => 10
-10.numerator # => -10
//}
@see Integer#denominator... -
Complex
# numerator -> Complex (18122.0) -
分子を返します。
...分子を返します。
//emlist[例][ruby]{
Complex('1/2+2/3i').numerator # => (3+4i)
Complex(3).numerator # => (3+0i)
//}
@see Complex#denominator... -
Enumerator
:: Lazy # drop(n) -> Enumerator :: Lazy (3121.0) -
Enumerable#drop と同じですが、配列ではなくEnumerator::Lazy を返します。
...、配列ではなくEnumerator::Lazy を返します。
@param n 要素数を指定します。
@raise ArgumentError n に負の数を指定した場合に発生します。
//emlist[例][ruby]{
1.step.lazy.drop(3)
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:drop(3)>
1.s......tep.lazy.drop(3).take(10).force
# => [4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
//}
@see Enumerable#drop... -
Enumerator
:: Lazy # take(n) -> Enumerator :: Lazy (3121.0) -
Enumerable#take と同じですが、配列ではなくEnumerator::Lazy を返します。
...ですが、配列ではなくEnumerator::Lazy を返します。
n が大きな数 (100000とか) の場合に備えて再定義されています。
配列が必要な場合は Enumerable#first を使って下さい。
@param n 要素数を指定します。
@raise ArgumentError n に負の数......を指定した場合に発生します。
//emlist[例][ruby]{
1.step.lazy.take(5)
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:take(5)>
1.step.lazy.take(5).force
# => [1, 2, 3, 4, 5]
//}
@see Enumerable#take... -
Enumerator
# with _ object(obj) -> Enumerator (3115.0) -
繰り返しの各要素に obj を添えてブロックを繰り返し、obj を返り値として返します。
...かった場合は、上で説明した繰り返しを実行し、
最後に obj を返す Enumerator を返します。
//emlist[例][ruby]{
# 0,1,2 と呼びだす enumeratorを作る
to_three = Enumerator.new do |y|
3.times do |x|
y << x
end
end
to_three_with_string = to_three.with_obje......ct("foo")
to_three_with_string.each do |x,string|
puts "#{string}: #{x}"
end
# => foo:0
# => foo:1
# => foo:2
//}
@param obj 繰り返しの各要素に添えて渡されるオブジェクト
@see Enumerable#each_with_object... -
Enumerator
:: Lazy # collect {|item| . . . } -> Enumerator :: Lazy (3115.0) -
Enumerable#map と同じですが、配列ではなくEnumerator::Lazy を返します。
...ですが、配列ではなくEnumerator::Lazy を返します。
@raise ArgumentError ブロックを指定しなかった場合に発生します。
//emlist[例][ruby]{
1.step.lazy.map{ |n| n % 3 == 0 }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:map>
1.step.lazy.collec......t{ |n| n.succ }.take(10).force
# => [2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
//}
@see Enumerable#map... -
Enumerator
:: Lazy # collect _ concat {|item| . . . } -> Enumerator :: Lazy (3115.0) -
ブロックの実行結果をひとつに繋げたものに対してイテレートするような Enumerator::Lazy のインスタンスを返します。
...ブロックの実行結果をひとつに繋げたものに対してイテレートするような
Enumerator::Lazy のインスタンスを返します。
//emlist[][ruby]{
["foo", "bar"].lazy.flat_map {|i| i.each_char.lazy}.force
#=> ["f", "o", "o", "b", "a", "r"]
//}
ブロックの返した......Enumerator::Lazy) とき
それ以外のときは、x は分解されず、そのままの値として使われます。
//emlist[][ruby]{
[{a:1}, {b:2}].lazy.flat_map {|i| i}.force
#=> [{:a=>1}, {:b=>2}]
//}
@raise ArgumentError ブロックを指定しなかった場合に発生します。
@s...