Do

 view release on metacpan or  search on metacpan

t/0.90/use/Data_Object_RoleHas.t  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

=cut

use_ok "Data::Object::RoleHas";

ok 1 and done_testing;



( run in 0.802 second using v1.01-cache-2.11-cpan-39bf76dae61 )