5259件ヒット
[1-100件を表示]
(0.182秒)
ライブラリ
- ビルトイン (4181)
- date (33)
- ipaddr (22)
- mathn (11)
- matrix (189)
-
minitest
/ unit (7) - mkmf (22)
-
net
/ ftp (22) -
net
/ http (6) -
net
/ pop (11) - openssl (55)
- ostruct (11)
- pathname (57)
- prime (44)
- psych (11)
-
rdoc
/ stats (88) -
rexml
/ document (44) -
rubygems
/ source _ index (11) - set (143)
- stringio (83)
- thread (2)
- tsort (30)
- un (11)
-
win32
/ registry (88) - zlib (44)
クラス
-
ARGF
. class (130) - Array (296)
- Bignum (102)
- Complex (110)
- Date (33)
- Dir (17)
-
Encoding
:: Converter (11) - Enumerator (171)
-
Enumerator
:: ArithmeticSequence (84) -
Enumerator
:: Chain (30) -
Enumerator
:: Lazy (378) -
Enumerator
:: Yielder (27) - Fixnum (108)
- Float (22)
-
Gem
:: SourceIndex (11) - Hash (152)
- IO (152)
- IPAddr (22)
- Integer (165)
- MatchData (44)
- Matrix (100)
-
Matrix
:: LUPDecomposition (22) -
MiniTest
:: Unit (6) -
Net
:: FTP (22) -
Net
:: HTTP (6) -
Net
:: POPMail (11) - Numeric (547)
- Object (68)
-
OpenSSL
:: BN (22) -
OpenSSL
:: Cipher (11) -
OpenSSL
:: SSL :: SSLContext (22) - OpenStruct (11)
- Pathname (57)
- Prime (11)
-
Prime
:: PseudoPrimeGenerator (33) -
Process
:: Status (11) -
Psych
:: Nodes :: Node (11) -
RDoc
:: Options (33) -
RDoc
:: Stats (88) -
REXML
:: Parent (44) - Range (51)
- Rational (15)
-
RubyVM
:: InstructionSequence (86) - Set (121)
- String (73)
- StringIO (83)
- Struct (39)
-
Thread
:: Queue (11) - Vector (67)
-
Win32
:: Registry (88) -
Zlib
:: GzipReader (44)
モジュール
- Enumerable (1316)
- Kernel (33)
-
MiniTest
:: Assertions (1) - TSort (30)
キーワード
- % (40)
- & (17)
- * (17)
- ** (21)
- + (34)
- +@ (11)
- - (28)
- -@ (17)
-
/ (23) - < (3)
- << (28)
- <= (3)
- <=> (17)
- == (12)
- === (3)
- > (3)
- >= (3)
- >> (28)
- [] (50)
- ^ (17)
-
_ assertions (1) - abs (28)
- abs2 (22)
-
absolute
_ path (11) - all? (29)
- angle (11)
- any? (29)
- arg (11)
- ascend (11)
-
assertion
_ count (1) -
base
_ label (11) - begin (6)
-
bit
_ length (6) - bsearch (22)
-
bsearch
_ index (9) - bytes (21)
- ceil (11)
- chain (6)
- chars (21)
- chunk (33)
-
chunk
_ while (19) - codepoints (21)
- coerce (11)
- collect (66)
- collect! (23)
- collect2 (11)
-
collect
_ concat (33) - combination (11)
- compact (6)
- conj (11)
- conjugate (11)
-
convertible
_ int (22) - count (33)
- cycle (33)
-
delete
_ if (33) - denominator (11)
- descend (11)
-
descriptor
_ length (11) - det (22)
- detect (22)
- determinant (22)
- difference (11)
- div (17)
- divmod (39)
- downto (22)
- drop (22)
-
drop
_ while (44) - each (266)
- each2 (11)
-
each
_ byte (55) -
each
_ char (44) -
each
_ child (28) -
each
_ codepoint (44) -
each
_ cons (22) -
each
_ entry (24) -
each
_ grapheme _ cluster (7) -
each
_ index (22) -
each
_ key (11) -
each
_ line (99) -
each
_ pair (33) -
each
_ slice (22) -
each
_ strongly _ connected _ component (10) -
each
_ strongly _ connected _ component _ from (10) -
each
_ value (11) -
each
_ with _ index (44) -
each
_ with _ object (22) - eager (5)
- end (6)
- entries (11)
-
enum
_ for (44) - eql? (14)
- errors (1)
- even? (6)
-
exclude
_ end? (6) - failures (1)
- fdiv (28)
- feed (11)
- filter (36)
- filter! (12)
-
filter
_ map (15) - find (33)
-
find
_ all (33) -
find
_ index (55) - finite? (8)
- first (34)
-
first
_ lineno (11) -
flat
_ map (33) - floor (11)
- force (11)
- grep (33)
-
grep
_ v (31) -
group
_ by (22) - gsub (11)
- gsub! (11)
- hash (9)
- httpd (11)
- i (11)
- imag (22)
- imaginary (22)
- include? (11)
-
include
_ line _ numbers (11) - index (22)
- infinite? (8)
- info (11)
- inject (33)
- inspect (29)
- integer? (11)
- intersection (11)
-
keep
_ if (22) - label (11)
- last (12)
- lazy (22)
-
line
_ numbers (11) -
line
_ numbers= (11) - lineno= (33)
- lines (49)
- magnitude (28)
- map (66)
- map! (23)
- max (44)
-
max
_ by (44) -
max
_ key _ length (11) -
max
_ value _ length (11) -
max
_ value _ name _ length (11) - member? (11)
- merge (11)
- min (44)
-
min
_ by (44) - minmax (22)
-
minmax
_ by (22) - modulo (28)
- negative? (9)
- next (11)
-
next
_ values (11) - none? (29)
- nonzero? (11)
-
num
_ bits (11) -
num
_ bytes (11) -
num
_ classes (11) -
num
_ classes= (11) -
num
_ files (11) -
num
_ files= (11) -
num
_ keys (11) -
num
_ methods (11) -
num
_ methods= (11) -
num
_ modules (11) -
num
_ modules= (11) -
num
_ values (11) -
num
_ waiting (11) - number (11)
- numerator (55)
- odd? (6)
- one? (29)
-
open
_ timeout (11) - partition (22)
- path (11)
- peek (11)
-
peek
_ values (11) - permutation (11)
- phase (11)
-
pkcs5
_ keyivgen (11) - polar (22)
- positive? (9)
- pow (11)
- putback (11)
- quo (11)
-
read
_ timeout (11) - real (22)
- real? (11)
- rect (22)
- rectangular (22)
- reduce (33)
- reject (55)
- reject! (22)
- remainder (25)
-
renegotiation
_ cb= (11) -
repeated
_ combination (11) -
repeated
_ permutation (11) - replace (11)
-
reverse
_ each (33) - rewind (17)
- rindex (11)
- round (11)
- run (1)
- select (66)
- select! (22)
-
session
_ cache _ stats (11) - size (29)
- skips (1)
-
slice
_ after (42) -
slice
_ before (55) -
slice
_ when (21) - sort (22)
-
sort
_ by (22) -
sort
_ by! (11) - step (118)
- subtract (11)
- succ (3)
- sum (22)
- take (22)
-
take
_ while (55) - tally (8)
-
test
_ count (1) - then (6)
- times (11)
-
to
_ a (22) -
to
_ binary (9) -
to
_ c (11) -
to
_ enum (44) -
to
_ f (6) -
to
_ h (17) -
to
_ int (11) -
to
_ proc (5) -
to
_ s (17) -
to
_ set (22) -
transform
_ keys (7) -
transform
_ keys! (7) -
transform
_ values (8) -
transform
_ values! (8) - truncate (11)
-
tsort
_ each (10) - union (11)
- uniq (38)
- upto (22)
-
with
_ index (43) -
with
_ object (33) -
write
_ timeout (6) - wtime (11)
- yield (11)
-
yield
_ self (7) - zero? (14)
- zip (44)
- | (17)
- ~ (6)
検索結果
先頭5件
- Enumerator
:: Lazy # enum _ for(method = :each , *args) -> Enumerator :: Lazy - Enumerator
:: Lazy # enum _ for(method = :each , *args) {|*args| block} -> Enumerator :: Lazy - Enumerator
:: Lazy # to _ enum(method = :each , *args) -> Enumerator :: Lazy - Enumerator
:: Lazy # to _ enum(method = :each , *args) {|*args| block} -> Enumerator :: Lazy - Numeric
# numerator -> Integer
-
Enumerator
:: Lazy # enum _ for(method = :each , *args) -> Enumerator :: Lazy (18455.0) -
Object#to_enum と同じですが、Enumerator::Lazy を返します。
...Object#to_enum と同じですが、Enumerator::Lazy を返します。
to_enum は「ブロック付きで呼ぶとループを実行し、ブロックを省略した場合は
Enumerator を返す」ようなメソッドを定義するときによく使われます。
このときに lazy 性が......_enum は
素のEnumerator ではなく Enumerator::Lazy を返すようになっています。
//emlist[例][ruby]{
module Enumerable
# 要素をn回ずつ繰り返すメソッド
# 例:[1,2,3].repeat(2) #=> [1,1,2,2,3,3]
def repeat(n)
raise ArgumentError if n < 0
if block_given?......each do |*val|
n.times { yield *val }
end
else
to_enum(:repeat, n)
end
end
end
r = 1..10
p r.map{|n| n**2}.repeat(2).first(5)
#=> [1, 1, 4, 4, 9]
r = 1..Float::INFINITY
p r.lazy.map{|n| n**2}.repeat(2).first(5)
#=> [1, 1, 4, 4, 9]
# Lazy#to_enum のおかげで... -
Enumerator
:: Lazy # enum _ for(method = :each , *args) {|*args| block} -> Enumerator :: Lazy (18455.0) -
Object#to_enum と同じですが、Enumerator::Lazy を返します。
...Object#to_enum と同じですが、Enumerator::Lazy を返します。
to_enum は「ブロック付きで呼ぶとループを実行し、ブロックを省略した場合は
Enumerator を返す」ようなメソッドを定義するときによく使われます。
このときに lazy 性が......_enum は
素のEnumerator ではなく Enumerator::Lazy を返すようになっています。
//emlist[例][ruby]{
module Enumerable
# 要素をn回ずつ繰り返すメソッド
# 例:[1,2,3].repeat(2) #=> [1,1,2,2,3,3]
def repeat(n)
raise ArgumentError if n < 0
if block_given?......each do |*val|
n.times { yield *val }
end
else
to_enum(:repeat, n)
end
end
end
r = 1..10
p r.map{|n| n**2}.repeat(2).first(5)
#=> [1, 1, 4, 4, 9]
r = 1..Float::INFINITY
p r.lazy.map{|n| n**2}.repeat(2).first(5)
#=> [1, 1, 4, 4, 9]
# Lazy#to_enum のおかげで... -
Enumerator
:: Lazy # to _ enum(method = :each , *args) -> Enumerator :: Lazy (18455.0) -
Object#to_enum と同じですが、Enumerator::Lazy を返します。
...Object#to_enum と同じですが、Enumerator::Lazy を返します。
to_enum は「ブロック付きで呼ぶとループを実行し、ブロックを省略した場合は
Enumerator を返す」ようなメソッドを定義するときによく使われます。
このときに lazy 性が......_enum は
素のEnumerator ではなく Enumerator::Lazy を返すようになっています。
//emlist[例][ruby]{
module Enumerable
# 要素をn回ずつ繰り返すメソッド
# 例:[1,2,3].repeat(2) #=> [1,1,2,2,3,3]
def repeat(n)
raise ArgumentError if n < 0
if block_given?......each do |*val|
n.times { yield *val }
end
else
to_enum(:repeat, n)
end
end
end
r = 1..10
p r.map{|n| n**2}.repeat(2).first(5)
#=> [1, 1, 4, 4, 9]
r = 1..Float::INFINITY
p r.lazy.map{|n| n**2}.repeat(2).first(5)
#=> [1, 1, 4, 4, 9]
# Lazy#to_enum のおかげで... -
Enumerator
:: Lazy # to _ enum(method = :each , *args) {|*args| block} -> Enumerator :: Lazy (18455.0) -
Object#to_enum と同じですが、Enumerator::Lazy を返します。
...Object#to_enum と同じですが、Enumerator::Lazy を返します。
to_enum は「ブロック付きで呼ぶとループを実行し、ブロックを省略した場合は
Enumerator を返す」ようなメソッドを定義するときによく使われます。
このときに lazy 性が......_enum は
素のEnumerator ではなく Enumerator::Lazy を返すようになっています。
//emlist[例][ruby]{
module Enumerable
# 要素をn回ずつ繰り返すメソッド
# 例:[1,2,3].repeat(2) #=> [1,1,2,2,3,3]
def repeat(n)
raise ArgumentError if n < 0
if block_given?......each do |*val|
n.times { yield *val }
end
else
to_enum(:repeat, n)
end
end
end
r = 1..10
p r.map{|n| n**2}.repeat(2).first(5)
#=> [1, 1, 4, 4, 9]
r = 1..Float::INFINITY
p r.lazy.map{|n| n**2}.repeat(2).first(5)
#=> [1, 1, 4, 4, 9]
# Lazy#to_enum のおかげで... -
Numeric
# numerator -> Integer (18201.0) -
自身を Rational に変換した時の分子を返します。
...自身を Rational に変換した時の分子を返します。
@return 分子を返します。
@see Numeric#denominator、Integer#numerator、Float#numerator、Rational#numerator、Complex#numerator... -
Object
# enum _ for(method = :each , *args) -> Enumerator (12443.0) -
Enumerator.new(self, method, *args) を返します。
...Enumerator.new(self, method, *args) を返します。
ブロックを指定した場合は Enumerator#size がブロックの評価結果を返
します。ブロックパラメータは引数 args です。
@param method メソッド名の文字列かシンボルです。
@param args 呼び出......"xyz"
enum = str.enum_for(:each_byte)
p(a = enum.map{|b| '%02x' % b }) #=> ["78", "79", "7a"]
# protects an array from being modified
a = [1, 2, 3]
p(a.to_enum) #=> #<Enumerator: [1, 2, 3]:each>
//}
//emlist[例(ブロックを指定する場合)][ruby]{
module Enumerable
def repeat(n)
rai......ntError, "#{n} is negative!" if n < 0
unless block_given?
# __method__ はここでは :repeat
return to_enum(__method__, n) do
# size メソッドが nil でなければ size * n を返す。
sz = size
sz * n if sz
end
end
each do |*val|
n... -
Object
# enum _ for(method = :each , *args) {|*args| . . . } -> Enumerator (12443.0) -
Enumerator.new(self, method, *args) を返します。
...Enumerator.new(self, method, *args) を返します。
ブロックを指定した場合は Enumerator#size がブロックの評価結果を返
します。ブロックパラメータは引数 args です。
@param method メソッド名の文字列かシンボルです。
@param args 呼び出......"xyz"
enum = str.enum_for(:each_byte)
p(a = enum.map{|b| '%02x' % b }) #=> ["78", "79", "7a"]
# protects an array from being modified
a = [1, 2, 3]
p(a.to_enum) #=> #<Enumerator: [1, 2, 3]:each>
//}
//emlist[例(ブロックを指定する場合)][ruby]{
module Enumerable
def repeat(n)
rai......ntError, "#{n} is negative!" if n < 0
unless block_given?
# __method__ はここでは :repeat
return to_enum(__method__, n) do
# size メソッドが nil でなければ size * n を返す。
sz = size
sz * n if sz
end
end
each do |*val|
n... -
Object
# to _ enum(method = :each , *args) -> Enumerator (12443.0) -
Enumerator.new(self, method, *args) を返します。
...Enumerator.new(self, method, *args) を返します。
ブロックを指定した場合は Enumerator#size がブロックの評価結果を返
します。ブロックパラメータは引数 args です。
@param method メソッド名の文字列かシンボルです。
@param args 呼び出......"xyz"
enum = str.enum_for(:each_byte)
p(a = enum.map{|b| '%02x' % b }) #=> ["78", "79", "7a"]
# protects an array from being modified
a = [1, 2, 3]
p(a.to_enum) #=> #<Enumerator: [1, 2, 3]:each>
//}
//emlist[例(ブロックを指定する場合)][ruby]{
module Enumerable
def repeat(n)
rai......ntError, "#{n} is negative!" if n < 0
unless block_given?
# __method__ はここでは :repeat
return to_enum(__method__, n) do
# size メソッドが nil でなければ size * n を返す。
sz = size
sz * n if sz
end
end
each do |*val|
n... -
Object
# to _ enum(method = :each , *args) {|*args| . . . } -> Enumerator (12443.0) -
Enumerator.new(self, method, *args) を返します。
...Enumerator.new(self, method, *args) を返します。
ブロックを指定した場合は Enumerator#size がブロックの評価結果を返
します。ブロックパラメータは引数 args です。
@param method メソッド名の文字列かシンボルです。
@param args 呼び出......"xyz"
enum = str.enum_for(:each_byte)
p(a = enum.map{|b| '%02x' % b }) #=> ["78", "79", "7a"]
# protects an array from being modified
a = [1, 2, 3]
p(a.to_enum) #=> #<Enumerator: [1, 2, 3]:each>
//}
//emlist[例(ブロックを指定する場合)][ruby]{
module Enumerable
def repeat(n)
rai......ntError, "#{n} is negative!" if n < 0
unless block_given?
# __method__ はここでは :repeat
return to_enum(__method__, n) do
# size メソッドが nil でなければ size * n を返す。
sz = size
sz * n if sz
end
end
each do |*val|
n... -
Array
# find _ index -> Enumerator (12301.0) -
条件に一致する最初の要素の位置を返します。
...置を返します。
等しい要素がひとつもなかった場合は nil を返します。
//emlist[例][ruby]{
p [1, 0, 0, 1, 0].index(1) #=> 0
p [1, 0, 0, 0, 0].index(1) #=> 0
p [0, 0, 0, 0, 0].index(1) #=> nil
//}
ブロックが与えられた場合には、各要素を引数とし......返します。
一つも真にならなかった場合は nil を返します。
//emlist[例][ruby]{
p [0, 1, 0, 1, 0].index {|v| v > 0} #=> 1
//}
引数、ブロックのどちらも与えられなかった場合は、
Enumerator のインスタンスを返します。
@see Array#rindex...