Ricardo SIGNES wrote:
> Hm. What I really want is Role->meta->all_classes_composing, but that's
> not the worst thing ever. I'd rather have it work magically, but I can
> deal with three lines for the sake of great justice!
Reminds me that I always wanted some sort of COMPOSE hook for roles. In this
case, it would probably work like
package My::Role;
use Moose::Role;
use Moose::Util::TypeConstraints;
sub COMPOSE {
my ($consumer) = @_;
coerce $consumer, from 'HashRef', via { $consumer->new($_) };
}
1;
-rs