Thank you very much for your hint on how to give a parameter to an attribute trait! I did not find an example anywhere in the docs of MooseX::Role::Parameterized.
Now I see that this also does not solve my problem, I am sorry that I forgot an important fact: The value given to the trait is no constant, so it has to be a kind of lazy builder.
So more precisely, I need give an instance value to the trait, something like:
Is this possible? -maxhqhas rootdir => ( isa => 'Str', is => 'rw', ); has testdir => ( traits => ['DirOption'], isa => 'Str', is => 'rw', rootdir => $self->rootDir, );
In reply to Re^2: Moose: Where to define a method required by an attribute trait?
by maxhq
in thread Moose: Where to define a method required by an attribute trait?
by maxhq
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |