ライブラリ
- ビルトイン (2476)
- matrix (44)
- pp (11)
- readline (11)
-
rexml
/ document (22) -
ripper
/ filter (11) - set (66)
クラス
- Array (436)
- Enumerator (33)
-
Enumerator
:: ArithmeticSequence (12) -
Enumerator
:: Chain (6) -
Enumerator
:: Lazy (363) - Hash (34)
- Matrix (22)
- Module (22)
- Object (55)
- PP (11)
-
REXML
:: Elements (22) - Range (84)
- Refinement (3)
- Regexp (11)
-
Ripper
:: Filter (11) - Set (44)
- Struct (34)
-
Thread
:: Queue (6) - Vector (22)
モジュール
- Enumerable (1316)
キーワード
- + (6)
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) - == (6)
- === (22)
- Chain (6)
- Enumerator (11)
- HISTORY (11)
- Lazy (11)
-
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 2
. 1 . 0 (11) -
NEWS for Ruby 2
. 2 . 0 (10) -
NEWS for Ruby 2
. 3 . 0 (9) -
NEWS for Ruby 2
. 4 . 0 (8) -
NEWS for Ruby 2
. 5 . 0 (7) -
NEWS for Ruby 2
. 6 . 0 (6) -
NEWS for Ruby 2
. 7 . 0 (5) -
NEWS for Ruby 3
. 0 . 0 (4) -
NEWS for Ruby 3
. 1 . 0 (3) - Range (11)
- Ruby用語集 (11)
- all? (47)
- any? (56)
- build (22)
- chain (6)
- chunk (33)
-
chunk
_ while (19) - collect (66)
- collect! (11)
-
collect
_ concat (33) - compact (6)
- count (66)
- cycle (22)
-
delete
_ if (11) - detect (22)
- drop (33)
-
drop
_ while (55) - each (22)
-
each
_ cons (22) -
each
_ entry (22) -
each
_ slice (22) -
each
_ with _ index (22) -
each
_ with _ object (22) - entries (11)
-
enum
_ for (44) - filter (42)
-
filter
_ map (15) - find (22)
-
find
_ all (33) -
find
_ index (33) - first (22)
-
flat
_ map (33) - force (11)
- grep (33)
-
grep
_ v (31) -
group
_ by (22) - hash (6)
-
import
_ methods (3) - include (22)
- include? (11)
- inject (44)
- lazy (11)
- map (55)
- map! (11)
- max (118)
-
max
_ by (44) - member? (11)
- min (118)
-
min
_ by (44) - minmax (32)
-
minmax
_ by (22) - new (23)
- none? (47)
- one? (47)
- parse (11)
- partition (22)
- prepended (11)
- produce (5)
- reduce (33)
- reject (99)
- reject! (11)
-
reverse
_ each (22) -
ruby 1
. 6 feature (11) -
ruby 1
. 9 feature (11) - select (77)
- seplist (11)
- set (11)
-
slice
_ after (42) -
slice
_ before (55) -
slice
_ when (21) - sort (44)
- sort! (22)
-
sort
_ by (22) -
sort
_ by! (22) - sum (38)
- take (33)
-
take
_ while (66) - tally (8)
-
to
_ a (11) -
to
_ enum (44) -
to
_ h (29) -
to
_ set (22) - uniq (38)
-
with
_ object (22) - zip (44)
検索結果
-
NEWS for Ruby 2
. 0 . 0 (12.0) -
NEWS for Ruby 2.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
..._at に Range オブジェクトを与えた場合、配列の範囲外のインデックスについては nil を返します
* Enumerable
* 追加: Enumerable#lazy 遅延列挙のためのメソッドです
* Enumerator
* 追加: Enumerator#size サイズを遅延評価するため... -
NEWS for Ruby 2
. 1 . 0 (12.0) -
NEWS for Ruby 2.1.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...* 追加: Binding#local_variable_get
* 追加: Binding#local_variable_set
* 追加: Binding#local_variable_defined?
* Enumerable
* 追加: Enumerable#to_h キーと値のペアのリストをハッシュに変換します。
* Exception
* 追加: Exception#cause 一つ前... -
NEWS for Ruby 3
. 0 . 0 (12.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...14413
* `TRUE`/`FALSE`/`NIL` constants are no longer defined.
* Integer#zero? overrides Numeric#zero? for optimization. 16961
* Enumerable#grep and Enumerable#grep_v when passed a Regexp and no block no longer modify Regexp.last_match. 17030
* Requiring 'open-uri' no longer redefines `Kern... -
Object
# ===(other) -> bool (12.0) -
case 式で使用されるメソッドです。d:spec/control#case も参照してください。
...で Object#== を呼び出します。
when 節の式をレシーバーとして === を呼び出すことに注意してください。
また Enumerable#grep でも使用されます。
@param other 比較するオブジェクトです。
//emlist[][ruby]{
age = 12
# (0..2).===(12), (3..6).===......String class. But don't hit."
else
"unknown"
end
end
puts check([]) #=> unknown
puts check("mash-up in Ruby on Rails") #=> instance of String class. But not hit...
puts check("<Ruby's world>") #=> hit! <Ruby's world>
//}
@see Object#==, Range#===, Module#===, Regexp#===, Enumerable#grep... -
Range (12.0)
-
範囲オブジェクトのクラス。 範囲オブジェクトは文字どおり何らかの意味での範囲を表します。数の範囲はもちろん、 日付の範囲や、「"a" から "z" まで」といった文字列の範囲を表すこともできます。
...が「次の値」を返す succ メソッドを
持たなければなりません。
Range クラスには Enumerable が include してあるので,Range#each に
基づき、Enumerable モジュールが提供する多様なメソッドを使うことができます。
=== 破壊的な変更... -
Refinement
# import _ methods(*modules) -> self (12.0) -
モジュールからメソッドをインポートします。
...level)
' ' * level + self
end
end
module M
refine String do
import_methods StrUtils
end
end
using M
p "foo".indent(3) # => " foo"
module M
refine String do
import_methods Enumerable
# Can't import method which is not defined with Ruby code: Enumerable#drop
end
end
//}... -
Vector
# each -> Enumerator (12.0) -
ベクトルの各要素をブロックの引数として順にブロックを呼び出します。
...各要素をブロックの引数として順にブロックを呼び出します。
このクラスは Enumerable を include しているため、
このメソッドを経由して Enumerable の各メソッドを使うことができます。
ブロックを省略した場合は Enumerator を... -
Vector
# each {|e| . . . } -> self (12.0) -
ベクトルの各要素をブロックの引数として順にブロックを呼び出します。
...各要素をブロックの引数として順にブロックを呼び出します。
このクラスは Enumerable を include しているため、
このメソッドを経由して Enumerable の各メソッドを使うことができます。
ブロックを省略した場合は Enumerator を... -
ruby 1
. 6 feature (12.0) -
ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。
...inux]
: 2002-03-10 メソッドの戻り値
以下のメソッドの戻り値が正しくなりました。((<ruby-bugs-ja:PR#205>))
* ((<Enumerable/each_with_index>)) が self を返すようになった(以前は nil)
* ((<Process/Process.setpgrp>)) が返す値が不定だった。
* (......yield されたとき 1 つの引数が 1 要素の配列として渡されていました。
((<ruby-dev:13299>))
class X
include Enumerable
def each(&block)
block.call(1,2)
block.call(2,3)
block.call(3,4)
end
end
x = X.new
p x.to_a #=... -
set (12.0)
-
集合を表す Set クラスと、取り出し順序を保証した SortedSet クラスを提供 します。
...、集合要素はソートされた順序で取り出されます。
また、set ライブラリを require すると Enumerable モジュールが
拡張され、Enumerable#to_set の形で集合オブジェクトを生成できる
ようになります。
=== 注意事項
集合オブジェ......、集合要素を取り出す際の順序は保証されません。
また、set ライブラリを require すると Enumerable モジュールが
拡張され、Enumerable#to_set の形で集合オブジェクトを生成できる
ようになります。
=== 注意事項
集合オブジェ... -
Array
# max -> object | nil (7.0) -
最大の要素、もしくは最大の n 要素が降順に入った配列を返します。 全要素が互いに <=> メソッドで比較できることを仮定しています。
...が存在しなければ nil を返します。
引数を指定する形式では、空の配列を返します。
//emlist[例][ruby]{
[].max #=> nil
[].max(1) #=> []
[2, 5, 3].max #=> 5
[2, 5, 3].max(2) #=> [5, 3]
//}
@param n 取得する要素数。
@see Enumerable#max... -
Array
# max {|a , b| . . . } -> object | nil (7.0) -
ブロックの評価結果で各要素の大小判定を行い、最大の要素、もしくは最大の n 要素が降順に入った配列を返します。 引数を指定しない形式では要素が存在しなければ nil を返します。 引数を指定する形式では、空の配列を返します。
...[ruby]{
[].max {|a, b| a <=> b } #=> nil
[].max(1) {|a, b| a <=> b } #=> []
ary = %w(albatross dog horse)
ary.max {|a, b| a.length <=> b.length } #=> "albatross"
ary.max(2) {|a, b| a.length <=> b.length } #=> ["albatross", "horse"]
//}
@param n 取得する要素数。
@see Enumerable#max...