2 ms·
Yes, the author agrees with me that it's an intellectual exercise. I just wanted to underline that. Rubyists are a clever bunch, if you find yourself writing t
by vinceguidry 12y ago
Yes, the author agrees with me that it's an intellectual exercise. I just wanted to underline that.
Rubyists are a clever bunch, if you find yourself writing the same code over and over again, chances are somebody's already figured out how to refactor it appropriately, tucking away the details behind an intention-revealing module.
A better way to refactor code is in using Ruby's built-in metaprogramming abilities. Metaprogramming Ruby is the best book to show you how.
http://www.amazon.com/Metaprogramming-Ruby-Program-Like-Facets/dp/1941222129/ref=dp_ob_title_bk http://www.amazon.com/Metaprogramming-Ruby-Program-Like-Face...