From: "Berger, Daniel" Date: 2004-02-20T01:43:26+09:00 Subject: Re: PATCH: OpenStruct#initialize to yield self > -----Original Message----- > From: Gavin Sinclair [mailto:gsinclair@soyabean.com.au] > Sent: Thursday, February 19, 2004 5:51 AM > To: ruby-core@ruby-lang.org > Subject: PATCH: OpenStruct#initialize to yield self > > > This is a common approach I use to object initialization; I > don't know about other people. Thought it was worth > mentioning it here. It allows code like the following: > > record = OpenStruct.new do |r| > r.name = "John Smith" > r.age = 70 > r.pension = 300 > end > > Cheers, > Gavin I vote "yay" on this one. :) Dan