Skip to content

Commit

Permalink
Group builder shortcut docs together
Browse files Browse the repository at this point in the history
...because my brain likes things grouped logically, and has decided this is
the new logic.
  • Loading branch information
rsrchboy committed Mar 13, 2015
1 parent 1d08f06 commit 4345ace
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions lib/MooseX/AttributeShortcuts.pm
Expand Up @@ -514,6 +514,21 @@ Specifying C<builder =E<gt> 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<builder =E<gt> 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<clearer =E<gt> 1> will cause the following options to be set:
Expand Down Expand Up @@ -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<builder =E<gt> 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<isa> type constraint that
Expand Down

0 comments on commit 4345ace

Please sign in to comment.