H
henrikbrink
Hello!
Im making an application that loads and uses the methods of a class
dynamically. The class can then be altered while the application is
running, and the application loads the file containing the class every
time it is needed.
The strange thing is: It works fine when i add a method to the class.
The new method shows up. But if i remove a method, it acts as if it was
still there. How can that be?
Here's the code used to get the methods:
load "#{file}.rb"
myclass = Object.const_get "MyClass"
myclass_inst = myclass.new
methods = myclass_inst.methods
If I am not clear enough, please ask.
Regards, Henrik
Im making an application that loads and uses the methods of a class
dynamically. The class can then be altered while the application is
running, and the application loads the file containing the class every
time it is needed.
The strange thing is: It works fine when i add a method to the class.
The new method shows up. But if i remove a method, it acts as if it was
still there. How can that be?
Here's the code used to get the methods:
load "#{file}.rb"
myclass = Object.const_get "MyClass"
myclass_inst = myclass.new
methods = myclass_inst.methods
If I am not clear enough, please ask.
Regards, Henrik