From: Ruby Quiz Date: 2004-11-19T23:06:32+09:00 Subject: [QUIZ] Object Browser (#8) The three rules of Ruby Quiz: 1. Please do not post any solutions or spoiler discussion for this quiz until 48 hours have passed from the time on this message. 2. Support Ruby Quiz by submitting ideas as often as you can: http://www.grayproductions.net/ruby_quiz/ 3. Enjoy! -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= by Jim Menard Recently on ruby-talk, itsme123 asked if there was a generic object browser that will "interactively browse a graph of connected objects by showing their instance variables and letting me click through to browse". The quiz challenge: write such a browser. It should be able to start at any object or, if none is given to it, start at the main object ("self" at the top level of any Ruby script). The interface to the browser can be text-based or graphical. I'm thinking of something like the Squeak Explorer (the new inspector). It's a window that displays the object with an open/close triangle next to it. Click the triangle, and the ivars are exposed. V root: an OrderedCollection(a MyClass, a Number) V 1: a MyClass > name: 'the name' > anotherIvar: 42 > 2: a Number That's just one possible UI, of course. Bonus points for allowing modification of instance variable values and for allowing inspection of classes (remember, classes are objects, too!).