The select method is a powerful method that automatically iterates through a collection in a Ruby program and extracts the values you want. Enumerators are a fun and very powerful way of working with collections in Ruby, and after you get used to implementing the methods I think you'll be shocked at how efficient it is integrate advanced functionality.
In this lesson, I'm going to show you how to sum up values in Ruby by implementing the powerful `inject` method and iterating over an array. Being able to sum up values in an array is something you will most likely need on a regular basis and Ruby makes this very straightforward to implement.
devCamp does not support ancient browsers.
Install a modern version for best experience.