Do
view release on metacpan or search on metacpan
lib/Data/Object/ClassHas.pm view on Meta::CPAN
The C<lazy> directive denotes whether the attribute will be constructed
on-demand, or on-construction. See the L<Moo> documentation for more details.
=item new
# lazy attribute
# create new_${attribute}
new => 1
The C<new> directive, if truthy, denotes that the attribute will be constructed
on-demand, i.e. is lazy, with a builder named C<new_{attribute}>. This ability
is not supported by the L<Moo> object superclass.
=item pre|predicate
# create has_${attribute}
pre => 1
predicate => 1
The C<predicate> directive expects a coderef and generates a method for
checking the existance of the attribute. See the L<Moo> documentation for more
details.
=item rdr|reader
# attribute reader
rdr => $reader
reader => $reader
The C<reader> directive denotes the name of the method to be used to "read" and
return the attribute's value. See the L<Moo> documentation for more details.
=item tgr|trigger
# attribute trigger
tgr => $trigger
trigger => $trigger
The C<trigger> directive expects a coderef and is executed whenever the
attribute's value is changed. See the L<Moo> documentation for more details.
=item use
# lazy dependency injection
use => ['service', 'datetime']
The C<use> directive denotes that the attribute will be constructed
on-demand, i.e. is lazy, using a custom builder meant to perform service
construction. This directive exists to provide a simple dependency injection
mechanism for class attributes. This ability is not supported by the L<Moo>
object superclass.
=item wkr|weak_ref
# weaken ref
wkr => 1
weak_ref => 1
The C<weak_ref> directive is used to denote if the attribute's value should be
weakened. See the L<Moo> documentation for more details.
=item wrt|writer
# attribute writer
wrt => $writer
writer => $writer
The C<writer> directive denotes the name of the method to be used to "write"
and return the attribute's value. See the L<Moo> documentation for more
details.
=back
=head1 CREDITS
Al Newkirk, C<+319>
Anthony Brummett, C<+10>
Adam Hopkins, C<+2>
José JoaquÃn Atria, C<+1>
=cut
=head1 AUTHOR
Al Newkirk, C<awncorp@cpan.org>
=head1 LICENSE
Copyright (C) 2011-2019, Al Newkirk, et al.
This is free software; you can redistribute it and/or modify it under the terms
of the The Apache License, Version 2.0, as elucidated here,
https://github.com/iamalnewkirk/do/blob/master/LICENSE.
=head1 PROJECT
L<Wiki|https://github.com/iamalnewkirk/do/wiki>
L<Project|https://github.com/iamalnewkirk/do>
L<Initiatives|https://github.com/iamalnewkirk/do/projects>
L<Milestones|https://github.com/iamalnewkirk/do/milestones>
L<Contributing|https://github.com/iamalnewkirk/do/blob/master/CONTRIBUTE.mkdn>
L<Issues|https://github.com/iamalnewkirk/do/issues>
=head1 SEE ALSO
To get the most out of this distribution, consider reading the following:
L<Do>
L<Data::Object>
( run in 0.620 second using v1.01-cache-2.11-cpan-39bf76dae61 )