Hi,
I'd like to ask some help with my problem with Moose. I need to create a
trait, or even better an overloaded type that does special stuff with "around"
accessor. Normally, one writes
has x => ( is => 'rw' ); around x => \&my_accessor;
I'd like to shorten that into
has x => ( is => 'rw', traits => ['MyAccessor']);
or even better, to
has x => ( isa => 'MyAccessor' );
possibly making MyAccessor a separate MooseX module.
I'd like to ask if you could help me here. I stopped here:
package Moose::Meta::Attribute::Custom::Trait::MyAccessor;
sub register_implementation { return 'MyAccessor' }
package MyAccessor;
use Moose::Role;
my $meta = __PACKAGE__->meta;
I thought that I should manipulate $meta, but I'm unsure how. Any ideas?
Thank you!
--
Sincerely,
Dmitry Karasik