Actually, that's not quite what I need.
I'd like to be able to inspect the sub-class to detect whether or not the method has been implemented rather than maintaining a list of unimplemented method.
So, I've extended the super-class to use Class::Fields too:
And this is the Automethod:
sub unimplemented :Automethod {
my $self = $_[0];
my $method_name = $_;
my $class = ref($self);
if ( ! $class->is_field( $method_name ) ) {
return sub {
OIO::Code->die('message' => "'$method_name' not implemented in class '$class'");
};
}
return; # Unrecognized method
}
This seems to work nicely.
Thanks,
R.