--- !ruby/object:RDoc::RI::MethodDescription 
aliases: []

block_params: 
comment: 
- !ruby/struct:RDoc::Markup::Flow::P 
  :body: Creates a new Enumerator object, which is to be used as an Enumerable object iterating in a given way.
- !ruby/struct:RDoc::Markup::Flow::P 
  :body: In the first form, a generated Enumerator iterates over the given object using the given method with the given arguments passed. Use of this form is discouraged. Use Kernel#enum_for(), alias to_enum, instead.
- !ruby/struct:RDoc::Markup::Flow::VERB 
  :body: "  e = Enumerator.new(ObjectSpace, :each_object)\n      #-&gt; ObjectSpace.enum_for(:each_object)\n\n  e.select { |obj| obj.is_a?(Class) }  #=&gt; array of all classes\n"
- !ruby/struct:RDoc::Markup::Flow::P 
  :body: In the second form, iteration is defined by the given block, in which a &quot;yielder&quot; object given as block parameter can be used to yield a value by calling the <tt>yield</tt> method, alias +&lt;&lt;+.
- !ruby/struct:RDoc::Markup::Flow::VERB 
  :body: "  fib = Enumerator.new { |y|\n    a = b = 1\n    loop {\n      y &lt;&lt; a\n      a, b = b, a + b\n    }\n  }\n\n  p fib.take(10) #=&gt; [1, 1, 2, 3, 5, 8, 13, 21, 34, 55]\n"
full_name: Enumerator::new
is_singleton: true
name: new
params: |
  Enumerator.new(obj, method = :each, *args)
  Enumerator.new { |y| ... }

visibility: public
