YES! One of my favorite ruby methods currently is to_enum so you can use all these convenience methods with your own.
I originally had this post titled "Level Up Your Ruby Skillz: Working with Enumerators" but wanted to make it very approachable to new devs learning Ruby and figured starting with straight Arrays would be better.
/developer|entrepreneur/i
Always looking for new developer talent, even those with zero experience, as you never know who's got the potential to become a great developer.
YES! One of my favorite ruby methods currently is to_enum so you can use all these convenience methods with your own.
I originally had this post titled "Level Up Your Ruby Skillz: Working with Enumerators" but wanted to make it very approachable to new devs learning Ruby and figured starting with straight Arrays would be better.
I didn't know about the buddy method enum_for which also looks super handy.
Everything in Ruby is an object, but maybe we should also say that everything, with the right attitude (or method call!), can be an Enumerator, too.