in reply to Private Attributes in Moose
has priv_attr => ( accessor => '_priv_attr', isa => 'Str', );
has _priv_attr => ( init_arg => 'priv_attr', is => 'rw', isa => 'Str', );
has _priv_attr => ( is => 'rw', isa => 'Str', );
has _priv_attr => ( init_arg => undef, is => 'rw', isa => 'Str', );
1: Can be initialised using ->new( priv_attr => ... ) 2: Can be initialised using ->new( priv_attr => ... ) 3: Can be initialised using ->new( _priv_attr => ... ) 4: Cannot be initialised from outside the class.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Private Attributes in Moose
by musiKk (Initiate) on Jul 23, 2011 at 16:10 UTC | |
by ikegami (Patriarch) on Jul 23, 2011 at 22:40 UTC |