On Fri 12 Apr 2002 at 02:15:25 +0900, you wrote:

> >>>>> "S" == Sean Middleditch <elanthis / awesomeplay.com> writes:
> 
> S> In the context of Ian McDonald's question - you have a reference of an
> S> instance variable, but you want the value from that reference. 
> S> attr_accessor doesn't help in that case (that I can think of), does it?
> 
>  Its example was [ruby-talk:38034]
> 
>     def each
>       self.instance_variables.each { |attr| yield(eval attr) }
>     end
> 
>  I don't know why it want to do this but when I want to make the instance
>  variables "public" I define accessors methods.

They _are_ public, but I wanted to define an each method that would
iterate over them. Perhaps the best way to do this is to opt for an
instance hash (instead of multiple scalars) and iterate over its keys.

Ian
-- 
Ian Macdonald               | You can't underestimate the power of fear. 
ian / caliban.org             | -- Tricia Nixon 
                            | 
                            | 
                            |