Ruby is a simple and powerful programming language. And users can reflect their own concept to Ruby script easily.
For example, you wanna make special iterator, Ruby lets you do it, of course.
Above class, IntegerArray, has each_odd method. This method provides iterator for each odd number.
How easy making custom method is. Ruby Advent Calendar jp-en: 2010
This entry is for Ruby Advent Calendar jp-en: 2010. The previous post was from ser1zw and the next post will be from technohippy. He is good at Google Wave and so on. Im looking forward to his entry.