るりまサーチ

最速Rubyリファレンスマニュアル検索!
6件ヒット [1-6件を表示] (0.010秒)
トップページ > クラス:Object[x] > クエリ:enum_for[x]

ライブラリ

検索結果

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

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

...に渡される引数です。
@raise NameError 存在しないメソッド名を指定すると発生します。

str = "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) #=>...

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

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

...に渡される引数です。
@raise NameError 存在しないメソッド名を指定すると発生します。

str = "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) #=>...

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

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

...に渡される引数です。
@raise NameError 存在しないメソッド名を指定すると発生します。

str = "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) #=>...

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

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

...に渡される引数です。
@raise NameError 存在しないメソッド名を指定すると発生します。

str = "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) #=>...