This post originated from an RSS feed registered with Ruby Buzz
by Matt Williams.
Original Post: Default values for Attributes
Feed Title: Ruby Blender
Feed URL: http://feeds2.feedburner.com/RubyBlender
Feed Description: This blog contains short-ish ruby tips, hints, and techniques.
This is the first in a series of entries which I’m pulling over articles from an old blog, revising, etc…
The Problem
One of the neat things about Ruby is it’s ability to create accessor methods for you, by simply declaring attr_reader, attr_writer, or attr_accessor. However, there’s not an easy way to define a default value for [...]