Sorry.  Pressed send by accident:  Let me complete my thought.

What I want to do provide a consuming class with a
  a) a meta-attribute (via a trait, 'My::MetaAttribute::Role' )
  b) methods to the meta-class. ( My::MetaClass::Role' ).

I think the answer is to use Moose::Exporter and/or
Moose::Util::MetaRole::apply_
metaroles.  This doesn't work, but something like:

    package My::Role

        use Moose::Role;

        Moose::Exporter->setup_import_methods(
            also => 'Moose',
            class_metaroles => {
                attribute => ['My::MetaAttribute::Role'],
                class => ['My::MetaClass::Role'],
            },
        )

I don't think this works for a variety of reason including the fact that
Moose::Exporter doesn't work when roles are consumed ... at least I think it
doesn't.  Am I correct in believing that you cannot use Moose::Exporter or
Moose::Util::MetaRole::apply_metarolse to work properly from a role?

Second, if I flip this to a class ( i.e. use Moose ), am I supposed to fuss
with defining an init_meta or will Moose Exporter see that I want
My::MetaAttribute::Role and My::MetaClass::Role installed and DWIM.  I think
this is the case, but I can't get it to work.
Am I mistaken?

Warmest Regards,

Chris

ps. I will shortly send some example code but wanted to get this to the list
to cover my being a boob about pressing send to quickly.

Reply via email to