From: "Dan Stevens (IAmAI)" Date: 2007-06-30T02:06:26+09:00 Subject: Re: Issue related to class initialization and irb > When the class is initialized in irb the content of every single instance > variable is dumped to the console. This library parses a lot of data from > various blocks, and has many data structures to hold it all. As such, this > output can contain as much as two screens worth. Some of this data is > non-readable and is for 'top-secret internal use only'. That is, it isn't > secret, but it has no value or use to the user directly ;). > > Anyway, I would really like to clean up this output and have irb print only > eg: > > => # Try defining a method called 'inspect' instead of 'to_s'. I'll assume you know how to form the desired string, as I don't know what methods are required to do that off the top of my head. On 29/06/07, darren kirby wrote: > Hello all, > > My class is a library that allows users to read information/tags etc from Flac > files. > > When the class is initialized in irb the content of every single instance > variable is dumped to the console. This library parses a lot of data from > various blocks, and has many data structures to hold it all. As such, this > output can contain as much as two screens worth. Some of this data is > non-readable and is for 'top-secret internal use only'. That is, it isn't > secret, but it has no value or use to the user directly ;). > > Anyway, I would really like to clean up this output and have irb print only > eg: > > => # > > Or perhaps the above with a brief enumeration of the blocks found and their > sizes and/or offsets. To this end I tried defining the class' to_s method, > and modifying the initialize method's return value. Neither had an effect. > How might I accomplish this? > > Thanks for consideration, > -d > -- > darren kirby :: Part of the problem since 1976 :: http://badcomputer.org > "...the number of UNIX installations has grown to 10, with more expected..." > - Dennis Ritchie and Ken Thompson, June 1972 > >