From: Michael Jessop Date: 2005-08-31T05:26:23+09:00 Subject: Question about Inheritance I have two simple classes. One inherits from the other and calls "super()" in its initialize method. But the super does not seem to do what I expect it to do. I expect the super() to initialize two variables, but when I call the method to display the initialized errors, I do not get the value (it things @errmsg is nil). Here they are: class DBBase def initalize @failed = false @errmsg = 'n/a' end def clear @failed = false @errmsg = 'n/a' end def failure @failed end def success @failed != true end def error "Error: #{@errmsg}" end def connect SQLite::Database.new(DBNAME) end attr_accessor :failed, :errmsg end (and here is the shortened version of the inheriting class)... ## This class models the People table. It allows the creation, ## loading, modification and saving of a single person. class Person < DBBase def initialize(id=nil, lname=nil, fname=nil, mname=nil, nname=nil, sex=nil, dob=nil) super() @id = id @lname = lname @fname = fname @mname = mname @nname = nname @sex = sex @dob = dob if @id != nil @added = false else @added = true end @modified = false @loaded = false end --------------------------