るりまサーチ

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

別のキーワード

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

クラス

検索結果

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

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

...す。ブロックパラメータは引数 args です。


@
param method メソッド名の文字列かシンボルです。
@
param args 呼び出すメソッドに渡される引数です。

//emlist[][ruby]{
str = "xyz"

enum = str.enum_for(:each_byte)
p(a = enum.map{|b| '%02x' % b }) #=> ["78",...
...each do |*val|
n.times { yield *val }
end
end
end

%i[hello world].repeat(2) { |w| puts w }
# => 'hello', 'hello', 'world', 'world'
enum = (1..14).repeat(3)
# => #<Enumerator: 1..14:repeat(3)>
enum.first(4) # => [1, 1, 1, 2]
enum.size # => 42
//}

@
see Enumerator, Enumerator#size...

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

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

...す。ブロックパラメータは引数 args です。


@
param method メソッド名の文字列かシンボルです。
@
param args 呼び出すメソッドに渡される引数です。

//emlist[][ruby]{
str = "xyz"

enum = str.enum_for(:each_byte)
p(a = enum.map{|b| '%02x' % b }) #=> ["78",...
...each do |*val|
n.times { yield *val }
end
end
end

%i[hello world].repeat(2) { |w| puts w }
# => 'hello', 'hello', 'world', 'world'
enum = (1..14).repeat(3)
# => #<Enumerator: 1..14:repeat(3)>
enum.first(4) # => [1, 1, 1, 2]
enum.size # => 42
//}

@
see Enumerator, Enumerator#size...

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

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

...す。ブロックパラメータは引数 args です。


@
param method メソッド名の文字列かシンボルです。
@
param args 呼び出すメソッドに渡される引数です。

//emlist[][ruby]{
str = "xyz"

enum = str.enum_for(:each_byte)
p(a = enum.map{|b| '%02x' % b }) #=> ["78",...
...each do |*val|
n.times { yield *val }
end
end
end

%i[hello world].repeat(2) { |w| puts w }
# => 'hello', 'hello', 'world', 'world'
enum = (1..14).repeat(3)
# => #<Enumerator: 1..14:repeat(3)>
enum.first(4) # => [1, 1, 1, 2]
enum.size # => 42
//}

@
see Enumerator, Enumerator#size...

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

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

...す。ブロックパラメータは引数 args です。


@
param method メソッド名の文字列かシンボルです。
@
param args 呼び出すメソッドに渡される引数です。

//emlist[][ruby]{
str = "xyz"

enum = str.enum_for(:each_byte)
p(a = enum.map{|b| '%02x' % b }) #=> ["78",...
...each do |*val|
n.times { yield *val }
end
end
end

%i[hello world].repeat(2) { |w| puts w }
# => 'hello', 'hello', 'world', 'world'
enum = (1..14).repeat(3)
# => #<Enumerator: 1..14:repeat(3)>
enum.first(4) # => [1, 1, 1, 2]
enum.size # => 42
//}

@
see Enumerator, Enumerator#size...