From: Robert Klemme Date: 2003-06-11T19:31:00+09:00 Subject: Re: Stack Frames, Functions and Variables. The Wiki link is http://www.rubygarden.org/ruby?MethodHooks robert "Robert Klemme" schrieb im Newsbeitrag news:... > > > I hacked something together that provides for hooking of methods. Look > for a thread called "How I'd like method-wrapping to work...". I can send > it to you directly if you want to. > > I'll put it on the wiki as soon as I can access it again. > > robert > > > "Grzegorz Dostatni" schrieb im Newsbeitrag > news:Pine.LNX.4.44.0306101627070.3875-100000@e5-05.ee.ualberta.ca... > > > > I have a number of questions: > > > > 1. Is it possible to examine current stack frame in ruby. Or move up in > > the stack frame to find the local variables of the function that called > > you? > > > > 2. Can I put a hook that gets called whenever anyone or anything > accesses > > a function AND/OR a variable within an object? I would like to intercept > > that call to create a nice wrapper. > > > > 3. This should be a really easy question to answer: > > > > Class Foo > > @test = "Hello World" > > end > > > > Class Bar > > @test = Foo.new > > > > def bar > > puts @test.@test (???) > > end > > end > > > > How do I access a local variable of an object pointed to as local > > variable. Is is a scoping problem? Are they just not visible? Should I > > make them public? Should I stand on a crossroads at midnight swinging a > > black cat in a circle thirteen times? > > > > Please help. > > > > Greg > > > > "Many a man may look respectable, and yet be able to hide at will behind > a > > spiral staircase." > > - Pelham (Plum) Grenville Wodehouse > > > > >