alex brie . net

Posts Tagged ‘programming

Other blogs about Ruby or Rails have already touched some of the tips I’m going to show, but it never hurts to remind you these small recipes aimed at Ruby novices:

07 Nov, 2007

Ruby Metaprogramming part 2

Posted by: Alex In: Rails| Ruby| Tips and Tricks

Last time I discussed Ruby and metaprogramming, I was trying to stay DRY (Don’t Repeat Yourself) while coding some very similar-looking methods. The solution, then was to use class_eval to dynamically add methods into the current class, the way attr_accessor and it’s peers already do.
Today I was having a similar, yet more difficult problem: the [...]


aboneaza-te la blogul meu

Categories