3 ms·
method_missing / AUTOLOAD is a great way to break any tools that rely on being able to introspect your classes. For something as simple as this, just add the m
by jrockway 16y ago
method_missing / AUTOLOAD is a great way to break any tools that rely on being able to introspect your classes.
For something as simple as this, just add the methods to the class in a loop. Then you class works just like every other class; no introspection is broken. It's also faster at runtime.
- tomafro 16y agoI can see how method_missing can break introspection, but I don't see how the same is true for Autoload. Could you give an example?
- draegtun 16y agoI believe jrockway is referring to AUTOLOAD in Perl (ie. its equivalent of Ruby's method_missing). ref: http://perldoc.perl.org/perlsub.html#Autoloading http://perldoc.perl.org/perlsub.html#Autoloading