From: Robert Klemme Date: 2006-01-21T22:20:16+09:00 Subject: Re: Basic Inheritance questions {noob alert:- pickaxe ed. 2, page 27} 2006/1/20, John Maclean : > Thanks for that speedy reply. I've decided to require the within the > child. One thing to note is that when I do require the child irb shows > the following.. > > cat fx/ruby/chap3/class_KaraokeSong.rb > > #!/usr/bin/env ruby > require 'class_Song.rb' > > # test if this class has been loaded correctly > Object.const_defined?(:Song) This test is completely superfluous. First, you don't do anything with the return value and second the next line will throw anyway: > class KaraokeSong < Song > def to_s > super + " [#@lyrics]" > end > end > > irb(main):011:0> require 'class_KaraokeSong.rb' > => false This just indicates that the file has been required already. Kind regards robert -- Have a look: http://www.flickr.com/photos/fussel-foto/