2484件ヒット
[1-100件を表示]
(0.048秒)
ライブラリ
クラス
-
ARGF
. class (93) - Array (324)
- Complex (24)
- Date (36)
- Dir (19)
- Enumerator (163)
-
Enumerator
:: ArithmeticSequence (70) -
Enumerator
:: Lazy (317) - Float (24)
- Hash (168)
- IO (138)
- Integer (60)
- Matrix (86)
- Numeric (81)
- Object (63)
- Pathname (39)
- Prime (12)
-
Prime
:: PseudoPrimeGenerator (36) - Range (59)
- Rational (24)
- String (80)
- StringIO (88)
- Struct (19)
- Vector (24)
-
Zlib
:: GzipReader (36)
モジュール
- Enumerable (368)
- TSort (33)
キーワード
- % (14)
- + (7)
- == (7)
- begin (7)
- bsearch (24)
-
bsearch
_ index (10) - bytes (14)
- chain (7)
- chars (14)
- chunk (36)
-
chunk
_ while (21) - codepoints (14)
- collect (48)
- collect! (19)
- collect2 (12)
-
collect
_ concat (12) - combination (12)
- cycle (24)
-
delete
_ if (24) - denominator (60)
- detect (12)
- downto (24)
- drop (12)
-
drop
_ while (24) - each (218)
- each2 (12)
-
each
_ byte (60) -
each
_ char (48) -
each
_ child (19) -
each
_ codepoint (24) -
each
_ cons (12) -
each
_ entry (15) -
each
_ grapheme _ cluster (8) -
each
_ index (12) -
each
_ key (12) -
each
_ line (108) -
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) - end (7)
-
enum
_ for (24) - feed (12)
- filter (35)
- filter! (14)
-
filter
_ map (12) - find (24)
-
find
_ all (24) -
find
_ index (36) - first (14)
-
flat
_ map (12) - grep (12)
-
grep
_ v (10) - gsub (12)
- gsub! (12)
- index (24)
-
keep
_ if (24) - last (14)
- lazy (12)
- lines (49)
- 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 (19)
-
slice
_ after (46) -
slice
_ before (60) -
slice
_ when (23) -
sort
_ by (12) -
sort
_ by! (12) - step (88)
- 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 (24)
-
with
_ index (24) -
with
_ object (36) -
yield
_ self (8) - zip (24)
検索結果
先頭5件
-
Numeric
# numerator -> Integer (18138.0) -
自身を Rational に変換した時の分子を返します。
...自身を Rational に変換した時の分子を返します。
@return 分子を返します。
@see Numeric#denominator、Integer#numerator、Float#numerator、Rational#numerator、Complex#numerator... -
Rational
# numerator -> Integer (18138.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 (18126.0) -
自身を Rational に変換した時の分子を返します。
...自身を Rational に変換した時の分子を返します。
@return 分子を返します。
//emlist[例][ruby]{
2.0.numerator # => 2
0.5.numerator # => 1
//}
@see Float#denominator... -
Integer
# numerator -> Integer (18126.0) -
分子(常に自身)を返します。
...分子(常に自身)を返します。
@return 分子を返します。
//emlist[][ruby]{
10.numerator # => 10
-10.numerator # => -10
//}
@see Integer#denominator... -
Complex
# numerator -> Complex (18120.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 (3119.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 (3119.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 (3113.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 (3113.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...