From: Ryan Leavengood Date: 2005-06-23T06:23:27+09:00 Subject: Re: Formatting the Object#inspect output Jeffrey Moss said: > When I'm working with large structures in IRB, I get a lot of output that > I can't really read all that well, all the # @something=>[#, #]> > > With larger objects I can't really tell what I'm looking for or where to > find it, it's just 100+ lines of garbage really, I'd like it to be > indented...... > > Any suggestions how I could format this stuff better? You know you can override inspect, right? irb(main):001:0> class Foo irb(main):002:1> def initialize irb(main):003:2> @a=['a','b','c'] irb(main):004:2> end irb(main):005:1> end => nil irb(main):006:0> f = Foo.new => # irb(main):007:0> class Foo irb(main):008:1> def inspect irb(main):009:2> "a is #{@a.inspect}" irb(main):010:2> end irb(main):011:1> end => nil irb(main):012:0> f => a is ["a", "b", "c"] Also, take a look at pp (pretty printer.) Ryan