クラス
-
ARGF
. class (119) - Array (461)
- Bignum (30)
- Data (4)
- Dir (39)
- Enumerator (99)
-
Enumerator
:: ArithmeticSequence (53) -
Enumerator
:: Chain (18) -
Enumerator
:: Lazy (320) -
Enumerator
:: Yielder (27) - File (66)
-
File
:: Stat (110) - Fixnum (27)
- Float (106)
- Hash (203)
- IO (167)
- Integer (49)
- LoadError (11)
- MatchData (92)
- Method (11)
- Module (27)
- Numeric (129)
- Object (57)
- Proc (11)
-
Process
:: Status (33) - Random (33)
- Range (62)
- Rational (132)
- Regexp (22)
-
RubyVM
:: InstructionSequence (11) - String (308)
- Struct (39)
- Symbol (11)
- Thread (33)
-
Thread
:: Backtrace :: Location (44) - Time (11)
- TracePoint (11)
- UnboundMethod (11)
モジュール
- Enumerable (490)
キーワード
- % (18)
- * (17)
- ** (17)
- + (17)
- - (17)
-
/ (17) - << (11)
- <=> (33)
- [] (88)
-
absolute
_ path (22) - all? (13)
- angle (22)
- any? (14)
-
append
_ features (11) - arg (22)
- atime (11)
-
backtrace
_ locations (22) -
base
_ label (11) - begin (16)
- blockdev? (11)
- bsearch (22)
-
bsearch
_ index (9) - byteindex (2)
- byteoffset (4)
- byterindex (2)
- bytes (14)
- ceil (23)
- chardev? (11)
- chars (14)
- chunk (33)
-
chunk
_ while (19) - codepoints (14)
- collect (33)
- collect! (11)
-
collect
_ concat (33) - combination (22)
- cycle (22)
-
delete
_ at (11) -
delete
_ if (22) - detect (11)
- div (6)
- downto (11)
-
drop
_ while (33) - each (178)
-
each
_ byte (33) -
each
_ char (33) -
each
_ child (6) -
each
_ codepoint (33) -
each
_ cons (11) -
each
_ entry (11) -
each
_ grapheme _ cluster (7) -
each
_ index (11) -
each
_ key (11) -
each
_ line (66) -
each
_ pair (22) -
each
_ slice (11) -
each
_ value (11) -
each
_ with _ index (11) -
each
_ with _ object (11) - eager (5)
- end (17)
-
enum
_ for (44) - exitstatus (11)
- fdatasync (11)
- fdiv (17)
-
fetch
_ values (18) - filter (30)
- filter! (12)
-
filter
_ map (10) - find (11)
-
find
_ all (22) -
find
_ index (22) - first (12)
-
flat
_ map (33) - flatten (11)
- flatten! (11)
- flock (11)
- floor (24)
- grep (33)
-
grep
_ v (31) -
group
_ by (11) - gsub (44)
- gsub! (44)
- index (22)
- infinite? (11)
- inspect (11)
-
keep
_ if (22) - last (12)
- lazy (11)
- lines (42)
- lstat (11)
- map (33)
- map! (11)
- match (55)
-
max
_ by (22) -
min
_ by (22) -
minmax
_ by (11) - modulo (6)
- none? (13)
- offset (22)
- one? (13)
- pack (19)
- partition (11)
- path (46)
- permutation (22)
- phase (22)
- private (16)
- quo (22)
- rand (33)
- reject (44)
- reject! (22)
- remainder (3)
-
repeated
_ combination (22) -
repeated
_ permutation (22) -
reverse
_ each (22) - rindex (22)
- round (34)
- scan (22)
- select (55)
- select! (22)
- setgid? (11)
- setuid? (11)
- size (34)
- size? (11)
-
slice
_ after (42) -
slice
_ before (55) -
slice
_ when (21) - socket? (11)
-
sort
_ by (11) -
sort
_ by! (11) -
source
_ location (33) - stat (11)
- status (11)
- step (90)
- sticky? (11)
- stopsig (11)
- sub (33)
- sub! (33)
- subsec (11)
-
take
_ while (44) - termsig (11)
- then (6)
- times (11)
-
to
_ enum (44) -
to
_ h (4) -
to
_ i (19) -
to
_ path (24) -
to
_ proc (5) -
to
_ s (11) - tr! (11)
-
tr
_ s! (11) -
transform
_ keys (7) -
transform
_ keys! (7) -
transform
_ values (8) -
transform
_ values! (8) - truncate (34)
- uniq (16)
- unpack (11)
- update (22)
- upto (11)
-
with
_ index (32) -
with
_ object (22) -
world
_ readable? (11) -
world
_ writable? (11) - yield (11)
-
yield
_ self (7) - zip (11)
検索結果
先頭5件
-
Array
# at(nth) -> object | nil (23208.0) -
nth 番目の要素を返します。nth 番目の要素が存在しない時には nil を返します。
nth 番目の要素を返します。nth 番目の要素が存在しない時には nil を返します。
@param nth インデックスを整数で指定します。
先頭の要素が 0 番目になります。nth の値が負の時には末尾から
のインデックスと見倣します。末尾の要素が -1 番目になります。
整数以外のオブジェクトを指定した場合は to_int メソッドによる
暗黙の型変換を試みます。
@raise TypeError 引数に整数以外の(暗黙の型変換が行えない)オブジェクトを
指定... -
Array
# repeated _ combination(n) -> Enumerator (20311.0) -
サイズ n の重複組み合わせをすべて生成し、それを引数としてブロックを実行 します。
...得られる組み合わせの順序は保証されません。ブロックなしで呼び出されると、
組み合わせを生成する Enumerator オブジェクトを返します。
@param n 生成される配列のサイズを整数で指定します。
整数以外のオブジェ......epeated_combination(1).to_a #=> [[1], [2], [3]]
a.repeated_combination(2).to_a #=> [[1,1],[1,2],[1,3],[2,2],[2,3],[3,3]]
a.repeated_combination(3).to_a #=> [[1,1,1],[1,1,2],[1,1,3],[1,2,2],[1,2,3],
# [1,3,3],[2,2,2],[2,2,3],[2,3,3],[3,3,3]]
a.repeated_combinatio......a.repeated_combination(0).to_a #=> [[]] # one combination of length 0
//}
ブロックが与えられた場合、作成した配列の各要素を引数としてブロックを実
行して self を返します。
//emlist[例][ruby]{
a = [1, 2, 3]
result = []
a.repeated_combination(3) {|e| resul... -
Array
# repeated _ combination(n) { |c| . . . } -> self (20311.0) -
サイズ n の重複組み合わせをすべて生成し、それを引数としてブロックを実行 します。
...得られる組み合わせの順序は保証されません。ブロックなしで呼び出されると、
組み合わせを生成する Enumerator オブジェクトを返します。
@param n 生成される配列のサイズを整数で指定します。
整数以外のオブジェ......epeated_combination(1).to_a #=> [[1], [2], [3]]
a.repeated_combination(2).to_a #=> [[1,1],[1,2],[1,3],[2,2],[2,3],[3,3]]
a.repeated_combination(3).to_a #=> [[1,1,1],[1,1,2],[1,1,3],[1,2,2],[1,2,3],
# [1,3,3],[2,2,2],[2,2,3],[2,3,3],[3,3,3]]
a.repeated_combinatio......a.repeated_combination(0).to_a #=> [[]] # one combination of length 0
//}
ブロックが与えられた場合、作成した配列の各要素を引数としてブロックを実
行して self を返します。
//emlist[例][ruby]{
a = [1, 2, 3]
result = []
a.repeated_combination(3) {|e| resul... -
Array
# repeated _ permutation(n) -> Enumerator (20311.0) -
サイズ n の重複順列をすべて生成し,それを引数としてブロックを実行します。
...実行します。
得られる順列の順序は保証されません。ブロックなしで呼び出されると, 順列
を生成する Enumerator オブジェクトを返します。
@param n 生成する配列のサイズを整数で指定します。
整数以外のオブジェ......eated_permutation(1).to_a #=> [[1], [2]]
a.repeated_permutation(2).to_a #=> [[1,1],[1,2],[2,1],[2,2]]
a.repeated_permutation(3).to_a #=> [[1,1,1],[1,1,2],[1,2,1],[1,2,2],
# [2,1,1],[2,1,2],[2,2,1],[2,2,2]]
a.repeated_permutation(0).to_a #=> [[]] # one permutati......ロックを実
行して self を返します。
//emlist[例][ruby]{
a = [1, 2]
result = []
a.repeated_permutation(3) {|e| result << e} # => [1,2]
result #=> [[1,1,1],[1,1,2],[1,2,1],[1,2,2],
# [2,1,1],[2,1,2],[2,2,1],[2,2,2]]
//}
@see Array#repeated_combination, Array#permutation... -
Array
# repeated _ permutation(n) { |p| . . . } -> self (20311.0) -
サイズ n の重複順列をすべて生成し,それを引数としてブロックを実行します。
...実行します。
得られる順列の順序は保証されません。ブロックなしで呼び出されると, 順列
を生成する Enumerator オブジェクトを返します。
@param n 生成する配列のサイズを整数で指定します。
整数以外のオブジェ......eated_permutation(1).to_a #=> [[1], [2]]
a.repeated_permutation(2).to_a #=> [[1,1],[1,2],[2,1],[2,2]]
a.repeated_permutation(3).to_a #=> [[1,1,1],[1,1,2],[1,2,1],[1,2,2],
# [2,1,1],[2,1,2],[2,2,1],[2,2,2]]
a.repeated_permutation(0).to_a #=> [[]] # one permutati......ロックを実
行して self を返します。
//emlist[例][ruby]{
a = [1, 2]
result = []
a.repeated_permutation(3) {|e| result << e} # => [1,2]
result #=> [[1,1,1],[1,1,2],[1,2,1],[1,2,2],
# [2,1,1],[2,1,2],[2,2,1],[2,2,2]]
//}
@see Array#repeated_combination, Array#permutation... -
Enumerator
:: Lazy # collect _ concat {|item| . . . } -> Enumerator :: Lazy (17317.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 ArgumentError ブロ......ックを指定しなかった場合に発生します。
@see Enumerable#flat_map... -
Enumerator
:: Lazy # flat _ map {|item| . . . } -> Enumerator :: Lazy (17317.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 ArgumentError ブロ......ックを指定しなかった場合に発生します。
@see Enumerable#flat_map... -
Process
:: Status # exitstatus -> Integer | nil (17204.0) -
exited? が真の場合プロセスが返した終了ステータスの整数を、そ うでない場合は nil を返します。
exited? が真の場合プロセスが返した終了ステータスの整数を、そ
うでない場合は nil を返します。 -
Thread
:: Backtrace :: Location # absolute _ path -> String (17115.0) -
self が表すフレームの絶対パスを返します。
...][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end
Foo.new(0..2).locations.map do |call|
puts call.absolute_path
end
# => /path/to/foo.rb
# /path/to/foo.rb
# /path/to/foo.rb
//}
@see Thread::Backtrace::Location#path... -
Regexp
# match(str , pos = 0) -> MatchData | nil (14430.0) -
指定された文字列 str に対して位置 pos から自身が表す正規表現によるマッ チングを行います。マッチした場合には結果を MatchData オブジェクトで返し ます。 マッチしなかった場合 nil を返します。
...MatchData オブジェクトで返し
ます。
マッチしなかった場合 nil を返します。
省略可能な第二引数 pos を指定すると、マッチの開始位置を pos から行
うよう制御できます(pos のデフォルト値は 0)。
//emlist[例][ruby]{
p(/(.).(.)/.matc.......captures) # => ["b", "r"]
p(/(.).(.)/.match("foobar", -3).captures) # => ["b", "r"]
//}
pos を指定しても MatchData#offset 等の結果
には影響しません。つまり、
//emlist[][ruby]{
re.match(str[pos..-1])
//}
と
//emlist[][ruby]{
re.match(str, pos)
//}
は異なります。......た場合に限り MatchData オブジェクトがブロック引数に渡されて実行されます。
マッチした場合はブロックの値を返し、マッチしなかった場合は nil を返します。
//emlist[例][ruby]{
results = []
/((.)\2)/.match("foo") {|m| results << m[0] } # =...