C
Chirag Patel
I would like to create a new superclass 'Super' for an existing class
'Sub'
class Sub
def new
#do something second
end
end
class Super < Sub
def new
#do something first
end
end
Is it possible create this new Super class so that Super::new is called
every time Sub:new is called without modifying Sub?
The is because Sub already exists and I don't want to tamper the code.
Basically I have a bunch of existing classes that I want to inherit from
'Super' so that I can include some error handling in 'Super'. Is there
another better way to accomplish this without modifying the existing
subclasses?
Thanks!
Chirag
'Sub'
class Sub
def new
#do something second
end
end
class Super < Sub
def new
#do something first
end
end
Is it possible create this new Super class so that Super::new is called
every time Sub:new is called without modifying Sub?
The is because Sub already exists and I don't want to tamper the code.
Basically I have a bunch of existing classes that I want to inherit from
'Super' so that I can include some error handling in 'Super'. Is there
another better way to accomplish this without modifying the existing
subclasses?
Thanks!
Chirag