diff --git a/lib/MooseX/AttributeShortcuts.pm b/lib/MooseX/AttributeShortcuts.pm index 101f27b..fcf767e 100644 --- a/lib/MooseX/AttributeShortcuts.pm +++ b/lib/MooseX/AttributeShortcuts.pm @@ -514,6 +514,21 @@ Specifying C 1> will cause the following options to be set: builder => "_build_$name" +=head2 builder => sub { ... } + +Passing a coderef to builder will cause that coderef to be installed in the +class this attribute is associated with the name you'd expect, and +C 1> to be set. + +e.g., in your class, + + has foo => (is => 'ro', builder => sub { 'bar!' }); + +...is effectively the same as... + + has foo => (is => 'ro', builder => '_build_foo'); + sub _build_foo { 'bar!' } + =head2 clearer => 1 Specifying C 1> will cause the following options to be set: @@ -556,21 +571,6 @@ For an attribute named "_foo": This naming scheme, in which the trigger is always private, is the same as the builder naming scheme (just with a different prefix). -=head2 builder => sub { ... } - -Passing a coderef to builder will cause that coderef to be installed in the -class this attribute is associated with the name you'd expect, and -C 1> to be set. - -e.g., in your class, - - has foo => (is => 'ro', builder => sub { 'bar!' }); - -...is effectively the same as... - - has foo => (is => 'ro', builder => '_build_foo'); - sub _build_foo { 'bar!' } - =head2 isa_instance_of => ... Given a package name, this option will create an C type constraint that