Duplication of code is one of the worst code smells. It should be refactored in order to keep DRY if only possible. This is generally easy. But what if the code itself is not duplicated, but its structure is? That could be a little bit more difficult, but with Ruby‘s metaprogamming facilities it’s not that hard. Read on to see how.
Tag Archives: metaprogramming
Looking for an easy way to manage agile project?
- Hash bars - simple ASCII-art charts in your console, database or Excel
- Easy and flexible breadcrumbs for Rails
- A simple shuffle that proved not so simple after all
- Does stubbing make your tests brittle?
- Cookie handling in multi-domain applications in Ruby on Rails
- Blast from the past: Compaq commercials with John Cleese
- Self-referential many-to-many relations in Ruby on Rails
- The endless cycle of code vs docs
- 265,156 hits