I have a Moose::Role
that I would like to call some extra subs on the class when that role is applied to the class.
Is there an easy way to modify what happens when the role is applied, without having to dig too much into Moose::Meta::Role
type coding? Ideally, I'd just like to after 'apply' => ...
to add the extra stuff.
Edit:
I'm specifically using this with a DBIx::Class::Core
result definition to create something like a component that also modifies the constructor. I would just write it as a component if I could get at BUILDARGS
and BUILD
subs for the result, but I can't seem to do. So, instead of doing load_component
, I doing with 'role'
, but some of the effects of the component are to add belongs_to
relationships to the class. Hence, I was thinking the best way to do that is during application of the role to the class.