Posted on 2007-03-19 17:45:47-07 by dsch04 in response to 4598
Re: Object::InsideOut with Class::Factory

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:

use Object::InsideOut qw( Class::Factory Class::Fields );

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.

Direct Responses: 4601 | 4602 | Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.