Fun with Delegate Methods

30 January 2010

Earlier this week, I needed to expose methods on an instance variable in a Rails Model. The details of why I needed to aren't as interesting as the options for implementation. Lets's take a look.

The first option is to create individual methods that delegate to the instance variable. This option is probably the easiest to understand, but verbose. We can do better.