From: darren kirby Date: 2006-06-07T06:37:13+09:00 Subject: Re: Attributes not populated until called? --nextPart3091303.9zWn1B3USz Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline quoth the ara.t.howard@noaa.gov: > On Wed, 7 Jun 2006, darren kirby wrote: > > def to_a > > ["#@title", "#@artist", "#@album", "#@genre", "#@year", "#@comment", > > "#@tracknum"] > > end > > end > > ATTRIBUTES =3D %w( title artist album genre year comment ) > > def to_a > ATTRIBUTES.map{|a| send a} > end Thank you! This worked perfectly... > you are using un-initialized instance vars - your methods are lazy > initializers, you need to use them here. > > -a Thanks again, =2Dd =2D-=20 darren kirby :: Part of the problem since 1976 :: http://badcomputer.org "...the number of UNIX installations has grown to 10, with more expected..." =2D Dennis Ritchie and Ken Thompson, June 1972 --nextPart3091303.9zWn1B3USz Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) iD8DBQBEhfWGwPD5Cr/3CJgRAsA+AKDeNKAQb80MbVq2AF9PQvP0f4MBgwCgiHFA 98z75q/AnGFeJa+SjpC/DFM= =JDYo -----END PGP SIGNATURE----- --nextPart3091303.9zWn1B3USz--