2706件ヒット
[1-100件を表示]
(0.085秒)
ライブラリ
クラス
-
ARGF
. class (126) - Array (312)
- Complex (24)
- Dir (19)
- Enumerator (151)
-
Enumerator
:: ArithmeticSequence (98) -
Enumerator
:: Chain (35) -
Enumerator
:: Lazy (298) -
Enumerator
:: Yielder (30) - Float (24)
-
Gem
:: SourceIndex (12) - Hash (168)
- IO (150)
- Matrix (86)
- Numeric (81)
- Object (63)
- OpenStruct (12)
- Pathname (63)
- Prime (12)
-
Prime
:: PseudoPrimeGenerator (36) -
Psych
:: Nodes :: Node (12) -
REXML
:: Parent (48) - Range (59)
- String (80)
- StringIO (81)
- Struct (43)
- Vector (74)
-
Zlib
:: GzipReader (36)
モジュール
- Enumerable (440)
- TSort (33)
キーワード
- % (14)
- + (7)
- << (12)
- == (7)
- ascend (12)
- begin (7)
- bsearch (24)
-
bsearch
_ index (10) - bytes (14)
- chain (7)
- chars (21)
- chunk (36)
-
chunk
_ while (21) - codepoints (21)
- collect (60)
- collect! (26)
- collect2 (12)
-
collect
_ concat (24) - combination (12)
- compact (4)
- cycle (24)
-
delete
_ if (36) - denominator (36)
- descend (12)
- detect (12)
-
drop
_ while (24) - each (292)
- each2 (12)
-
each
_ byte (60) -
each
_ char (48) -
each
_ child (31) -
each
_ codepoint (48) -
each
_ cons (12) -
each
_ entry (15) -
each
_ grapheme _ cluster (8) -
each
_ index (24) -
each
_ key (12) -
each
_ line (108) -
each
_ pair (36) -
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 (48) -
exclude
_ end? (7) - filter (28)
- filter! (14)
-
filter
_ map (6) - find (24)
-
find
_ all (12) -
find
_ index (36) - first (14)
-
flat
_ map (24) - force (12)
-
group
_ by (12) - gsub (12)
- gsub! (12)
- hash (7)
- index (24)
- inspect (14)
-
keep
_ if (24) - last (14)
- lazy (12)
- lines (49)
- map (60)
- map! (26)
-
max
_ by (24) -
min
_ by (24) -
minmax
_ by (12) - next (12)
-
next
_ values (12) - partition (12)
- peek (12)
-
peek
_ values (12) - permutation (12)
- reject (48)
- reject! (24)
-
repeated
_ combination (12) -
reverse
_ each (26) - rewind (7)
- rindex (12)
- select (60)
- select! (24)
- size (26)
-
slice
_ after (46) -
slice
_ before (60) -
slice
_ when (23) -
sort
_ by (12) -
sort
_ by! (12) - step (83)
-
take
_ while (48) - then (7)
-
to
_ enum (48) -
to
_ proc (6) -
transform
_ keys (8) -
transform
_ keys! (8) -
transform
_ values (9) -
transform
_ values! (9) -
tsort
_ each (11) -
with
_ index (36) -
with
_ object (36) - yield (12)
-
yield
_ self (8) - zip (24)
検索結果
先頭5件
-
Complex
# numerator -> Complex (21214.0) -
分子を返します。
...分子を返します。
//emlist[例][ruby]{
Complex('1/2+2/3i').numerator # => (3+4i)
Complex(3).numerator # => (3+0i)
//}
@see Complex#denominator... -
Numeric
# numerator -> Integer (21142.0) -
自身を Rational に変換した時の分子を返します。
...自身を Rational に変換した時の分子を返します。
@return 分子を返します。
@see Numeric#denominator、Integer#numerator、Float#numerator、Rational#numerator、Complex#numerator... -
Float
# numerator -> Integer (18130.0) -
自身を Rational に変換した時の分子を返します。
...自身を Rational に変換した時の分子を返します。
@return 分子を返します。
//emlist[例][ruby]{
2.0.numerator # => 2
0.5.numerator # => 1
//}
@see Float#denominator... -
Enumerator
:: Lazy # collect _ concat {|item| . . . } -> Enumerator :: Lazy (15301.0) -
ブロックの実行結果をひとつに繋げたものに対してイテレートするような Enumerator::Lazy のインスタンスを返します。
...行結果をひとつに繋げたものに対してイテレートするような
Enumerator::Lazy のインスタンスを返します。
//emlist[][ruby]{
["foo", "bar"].lazy.flat_map {|i| i.each_char.lazy}.force
#=> ["f", "o", "o", "b", "a", "r"]
//}
ブロックの返した値 x は、以下......ッドを持つとき
* x が each および force メソッドを持つ (例:Enumerator::Lazy) とき
それ以外のときは、x は分解されず、そのままの値として使われます。
//emlist[][ruby]{
[{a:1}, {b:2}].lazy.flat_map {|i| i}.force
#=> [{:a=>1}, {:b=>2}]
//}
@raise... -
IO
# each _ char -> Enumerator (12320.0) -
self に含まれる文字を一文字ずつブロックに渡して評価します。
...ません。
ブロックを省略した場合は各文字について繰り返す Enumerator を返します。
@raise IOError self が読み込み用にオープンされていない場合に発生します。
f = File.new("testfile")
f.each_char {|c| print c, ' ' } #=> #<File:testfile>... -
String
# each _ char -> Enumerator (12313.0) -
文字列の各文字に対して繰り返します。
...文字列の各文字に対して繰り返します。
たとえば、
//emlist[][ruby]{
"hello世界".each_char {|c| print c, ' ' }
//}
は次のように出力されます。
h e l l o 世 界
@see String#chars... -
Dir
# each _ child -> Enumerator (12307.0) -
ディレクトリの "." と ".." をのぞく各エントリを表す文字列を引数として、 ブロックを評価します。
...合、各エントリを文字列として保持する
Enumerator
オブジェクトを返します。
@raise IOError 既に self が close している場合に発生します。
//emlist[例][ruby]{
Dir.open('.').each_child{|f|
p f
}
#=> "bar"
# "foo"
//}
@see Dir#each
@see Dir.each_child... -
Enumerable
# collect _ concat -> Enumerator (12307.0) -
各要素をブロックに渡し、その返り値を連結した配列を返します。
...ックに渡し、その返り値を連結した配列を返します。
ブロックの返り値は基本的に配列を返すべきです。
ブロックを省略した場合は Enumerator を返します。
//emlist[例][ruby]{
[[1,2], [3,4]].flat_map{|i| i.map{|j| j*2}} # => [2,4,6,8]
//}... -
StringIO
# each _ char -> Enumerator (12302.0) -
自身に含まれる文字を一文字ずつブロックに渡して評価します。
...自身に含まれる文字を一文字ずつブロックに渡して評価します。
自身は読み込み用にオープンされていなければなりません。
@raise IOError 自身が読み込み用にオープンされていない場合に発生します。
@see IO#each_char... -
Pathname
# each _ child(with _ directory = true) -> Enumerator (12301.0) -
self.children(with_directory).each と同じです。
...self.children(with_directory).each と同じです。
@param with_directory 偽を指定するとファイル名のみ返します。デフォルトは真です。
//emlist[例][ruby]{
require "pathname"
Pathname("/usr/local").each_child {|f| p f }
# => #<Pathname:/usr/local/bin>
# => #<Pathname......:/usr/local/etc>
# => #<Pathname:/usr/local/include>
# => #<Pathname:/usr/local/lib>
# => #<Pathname:/usr/local/opt>
# => #<Pathname:/usr/local/sbin>
# => #<Pathname:/usr/local/share>
# => #<Pathname:/usr/local/var>
Pathname("/usr/local").each_child(false) {|f| p f }
# => #<Pathname:bin>
# => #<Pat......hname:etc>
# => #<Pathname:include>
# => #<Pathname:lib>
# => #<Pathname:opt>
# => #<Pathname:sbin>
# => #<Pathname:share>
# => #<Pathname:var>
//}
@see Pathname#children...