Class::Accessor::Lite::Lazy - Class::Accessor::Lite with lazy accessor feature
package MyPackage; use Class::Accessor::Lite::Lazy ( rw_lazy => [ qw(foo) ], ro_lazy => [ qw(bar) ], # Class::Accessor::Lite functionality is also available new => 1, rw => [ qw(baz) ], ); sub _build_foo { my $self = shift; ... } sub _build_bar { my $self = shift; ... }
Class::Accessor::Lite::Lazy provides a "lazy" accessor feature to Class::Accessor::Lite.
If a lazy accessor without any value set is called, a builder method is called to generate a value to set. The builder for an accessor $attr should be named as _build_$attr.
As Class::Accessor::Lite, the use statement provides the way to create lazy accessors.
Creates read / write lazy accessors.
Creates read-only lazy accessors.
Same as Class::Accessor::Lite.
Creates lazy accessors in current package.
Creates read-only lazy accessors in current package.
motemen <motemen@gmail.com>
Class::Accessor::Lite
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Class::Accessor::Lite::Lazy, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Class::Accessor::Lite::Lazy
CPAN shell
perl -MCPAN -e shell install Class::Accessor::Lite::Lazy
For more information on module installation, please visit the detailed CPAN module installation guide.