るりまサーチ

最速Rubyリファレンスマニュアル検索!
99件ヒット [1-99件を表示] (0.015秒)

別のキーワード

  1. _builtin enum_for
  2. _builtin to_enum
  3. object enum_for
  4. lazy enum_for
  5. object to_enum

ライブラリ

クラス

キーワード

検索結果

Object#enum_for(method = :each, *args) -> Enumerator (18114.0)

Enumerator.new(self, method, *args) を返します。

...r.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)
raise ArgumentError,...

Object#enum_for(method = :each, *args) {|*args| ... } -> Enumerator (18114.0)

Enumerator.new(self, method, *args) を返します。

...r.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)
raise ArgumentError,...

Enumerator::Lazy#enum_for(method = :each, *args) -> Enumerator::Lazy (18108.0)

Object#to_enum と同じですが、Enumerator::Lazy を返します。

...by]{
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
en...

Enumerator::Lazy#enum_for(method = :each, *args) {|*args| block} -> Enumerator::Lazy (18108.0)

Object#to_enum と同じですが、Enumerator::Lazy を返します。

...by]{
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
en...

Object#to_enum(method = :each, *args) -> Enumerator (3014.0)

Enumerator.new(self, method, *args) を返します。

...r.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)
raise ArgumentError,...

絞り込み条件を変える

Object#to_enum(method = :each, *args) {|*args| ... } -> Enumerator (3014.0)

Enumerator.new(self, method, *args) を返します。

...r.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)
raise ArgumentError,...

Enumerator::Lazy#to_enum(method = :each, *args) -> Enumerator::Lazy (3008.0)

Object#to_enum と同じですが、Enumerator::Lazy を返します。

...by]{
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
en...

Enumerator::Lazy#to_enum(method = :each, *args) {|*args| block} -> Enumerator::Lazy (3008.0)

Object#to_enum と同じですが、Enumerator::Lazy を返します。

...by]{
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
en...

NEWS for Ruby 2.0.0 (12.0)

NEWS for Ruby 2.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...: Kernel.#caller 第2引数で取得するスタックのサイズを指定できるようになりました
* 拡張: Object#to_enum Object#enum_for サイズの遅延評価のためにブロックを受け取るようになりました
* 非互換: Kernel.#system, Kernel.#exec は非標準...
...Signal.signame シグナルの名前を返します

* 非互換: Signal.trap は :SEGV, :BUS, :ILL, :FPE, :VTALRM が指定されると ArgumentError を発生させます

* String
* 追加: String#b エンコーディングを ASCII-8BIT に設定したコピーされた文字列を...