From: darren kirby Date: 2007-06-30T06:20:02+09:00 Subject: Re: Issue related to class initialization and irb quoth the Chris Shea: > On Jun 29, 11:17 am, darren kirby wrote: > > This is a follow-up question for me as well. Even when the object_id > > value is represented in hex it does not match the default output. I guess > > the default value is the object's address in memory or somesuch? > > The hex value is double the object_id. So in my example, redefining > inspect as > > "#" > > would give you what you're expecting. > > Chris Thanks again Chris. I still have one more issue here. My knowledge of access control is admittedly superficial, but since 'inspect' is called internally I should be able to define it as a private method shouldn't I? Or is it bombing because it is called from irb? When I define it privately I get: ----------------------- irb(main):016:0> song = FlacInfo.new("test.flac") NoMethodError: private method `inspect' called for # from /usr/lib/ruby/1.8/irb.rb:298:in `output_value' from /usr/lib/ruby/1.8/irb.rb:151:in `eval_input' from /usr/lib/ruby/1.8/irb.rb:259:in `signal_status' from /usr/lib/ruby/1.8/irb.rb:147:in `eval_input' from /usr/lib/ruby/1.8/irb/ruby-lex.rb:244:in `each_top_level_statement' from /usr/lib/ruby/1.8/irb/ruby-lex.rb:230:in `loop' from /usr/lib/ruby/1.8/irb/ruby-lex.rb:230:in `each_top_level_statement' from /usr/lib/ruby/1.8/irb/ruby-lex.rb:229:in `catch' from /usr/lib/ruby/1.8/irb/ruby-lex.rb:229:in `each_top_level_statement' from /usr/lib/ruby/1.8/irb.rb:146:in `eval_input' from /usr/lib/ruby/1.8/irb.rb:70:in `start' from /usr/lib/ruby/1.8/irb.rb:69:in `catch' from /usr/lib/ruby/1.8/irb.rb:69:in `start' from /usr/bin/irb:13 Maybe IRB bug!! ------------------------- Is this really a bug or is it just a necessary product of calling from irb? I don't really need or want this as a public method. I suppose I could just make it so Rdoc doesn't document it, as it isn't like it is going to hurt anything if called directly. -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