Actions
Feature #20476
openAdd Enumerator#eager that returns self, like Enumerator::Lazy#lazy
    Feature #20476:
    Add Enumerator#eager that returns self, like Enumerator::Lazy#lazy
  
Status:
Open
Assignee:
-
Target version:
-
Description
I'd like to propose adding an Enumerator#eager method. We currently have Enumerator#lazy, Enumerator::Lazy#lazy, Enumerator::Lazy#eager, but not Enumerator#eager.
I like that you can always call enum.lazy with any type of Enumerator since a lazy Enumerator will just return itself. This PR just adds an equivalent enum.eager for eager Enumerators. I've found it handy to be able to call .lazy to ensure that I have a lazy Enumerator and would like to be able to do the same with .eager, which currently is only implemented on Enumerator::Lazy.
        
           Updated by shan (Shannon Skipper) over 1 year ago
          Updated by shan (Shannon Skipper) over 1 year ago
          
          
        
        
      
      Added a PR https://github.com/ruby/ruby/pull/10739
Actions