in reply to Re: Moose: Where to define a method required by an attribute trait?
in thread Moose: Where to define a method required by an attribute trait?
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, );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Moose: Where to define a method required by an attribute trait?
by stvn (Monsignor) on Apr 29, 2010 at 11:45 UTC | |
by maxhq (Novice) on Apr 29, 2010 at 17:56 UTC | |
by stvn (Monsignor) on Apr 30, 2010 at 19:31 UTC | |
by maxhq (Novice) on May 04, 2010 at 09:38 UTC |