From: Luigi Ballabio Date: 2003-06-24T23:31:09+09:00 Subject: Inspecting a caller environment? Hi all, having to design a usable environment for non extremely-computer-literate users, I'd like them to fire up irb with some default options via an alias and write: Foo> foo = 'life' Foo> bar = 'the universe' Foo> baz = 'everything' Foo> calculate ==> 42 Foo> Here, the calculate() method would (in my dreams) inspect the caller's environment, find out the values of foo, bar and baz, and use them in its calculation. Of course, in the real thing the parameters would be a few more, and some of them could be omitted. Is there a decent way to accomplish this? Thanks, Luigi P.S. Of course I will accept suggestions for an altogether different way of enabling people to use my code. But the above seems an interesting problem in its own right, and now I got curious :) P.P.S. RTFM answers are welcome as well, when coupled with the relevant reference (I did skim through the pickaxe book, but without luck---the reflection thing only seems to apply to the current frame...)