From: David Vallner Date: 2006-12-04T01:18:56+09:00 Subject: Re: Simple and stuppid bug (can anyone find it?) --------------enig2A75EE277CB3DBA96007224F Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable paul wrote: > My second idea was to use attr_writer to set all the properties, but > chaining seemed saving me some lines (these assignments aren't that > exciting after all). >=20 Either way, I don't agree with the motivation, it's very easy to lose track of what you've assigned to in a method chain as an extension of the fact any method chain is a detriment to readability if the steps aren't trivial (e.g. require keeping in your head what the previous step returned). Personally, I'd go with the options hash Martin DeMello proposed. It's rather idiomatic, easier to read (a bit) than a method chain since initialisation logic is kept in the call to #new, and doesn't involve superfluous typing. David Vallner --------------enig2A75EE277CB3DBA96007224F Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (MingW32) iD8DBQFFcvjry6MhrS8astoRAoJxAJsG2SSzFY5TSW2s5V+C4myJbXSFGACfaLdI qTkhSWoRvkrgUcS6Ap9oqLs= =5zwv -----END PGP SIGNATURE----- --------------enig2A75EE277CB3DBA96007224F--