From: Robert Dober Date: 2006-06-07T06:41:06+09:00 Subject: Re: Attributes not populated until called? ------=_Part_53231_28831889.1149630062513 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 6/6/06, darren kirby wrote: > > quoth the Robert Dober: > > On 6/6/06, Robert Dober wrote: > > > > > > > No the programmatic behavior is clear, I fail to see the reason > though, > > > but there might be one. > > > As a matter of fact there is a good reason to cache the value of the > > > attribute in the reader but that would be done like this > > > > Sorry slipped from a key, continuing... > > > > @year ||=3D @tags.tag['date'] > > > > > > which will access the hash only once. > > I tried this and it is giving me the default tags (from the super class) > rather than using 'ogginfo'?! So is putting them in initialize() (see my > response to James Britt... That is strange, you mean @year is not initialized when calling to_a, but i= t is when calling the accessor method first? Anyway that might not be what you are interested in, the caching mechanism is maybe not what you wanted either, I was just guessing about semantics ;) Cheers Robert > Hope that helped > > Robert > > > > -d > > > > > > -- > > > > darren kirby :: Part of the problem since 1976 :: > > > > http://badcomputer.org "...the number of UNIX installations has > grown > > > > to 10, with more expected..." > > > > - Dennis Ritchie and Ken Thompson, June 1972 > > > > > > -- > > > Deux choses sont infinies : l'univers et la b=EAtise humaine ; en ce = qui > > > concerne l'univers, je n'en ai pas acquis la certitude absolue. > > > > > > - Albert Einstein > > -d > -- > darren kirby :: Part of the problem since 1976 :: http://badcomputer.org > "...the number of UNIX installations has grown to 10, with more > expected..." > - Dennis Ritchie and Ken Thompson, June 1972 > > > --=20 Deux choses sont infinies : l'univers et la b=EAtise humaine ; en ce qui concerne l'univers, je n'en ai pas acquis la certitude absolue. - Albert Einstein ------=_Part_53231_28831889.1149630062513--