MenTaLguY
2/18/2006 12:07:00 AM
Quoting ara.t.howard@noaa.gov:
> On Sat, 18 Feb 2006, Patrick Hurley wrote:
>
> > Thanks ok last question (probalby), if remove_instance_variable
> > is called, and the attribute is subsequently accessed is it
> > reset to the default value?
>
> good question. my version does not - the default is set once
> only. i would think re-setting an @var when
> remove_instance_variable has been called would be suprising
> behaviour - but it's up to you.
Depends. If you think of it in terms of the default value being
shadowed by @var if it exists, returning to the default value after
a remove_instance_variable would seem reasonable.
This indirectly brings to mind another question, though -- when and
how often is the block supposed to be called, if given? Once?
Per-class? Per-object? Per-get?
-mental