From: Chris Prather Date: Mon, 25 May 2009 16:54:11 +0000 (-0400) Subject: document required => 1 in lazy_build X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5eb86b246db78b40a7161e0b3d0063c915ebc973;p=gitmo%2FMoose.git document required => 1 in lazy_build --- diff --git a/lib/Moose.pm b/lib/Moose.pm index 3c24df2..ce5b4f5 100644 --- a/lib/Moose.pm +++ b/lib/Moose.pm @@ -635,8 +635,9 @@ Class::MOP::Attribute|Class::MOP::Attribute/predicate> for more information. =item I => (0|1) -Automatically define lazy => 1 as well as builder => "_build_$attr", clearer => -"clear_$attr', predicate => 'has_$attr' unless they are already defined. +Automatically define lazy => 1 as well as required => 1, builder => +"_build_$attr", clearer => "clear_$attr', predicate => 'has_$attr' unless they +are already defined. =item I => Str diff --git a/lib/Moose/Manual/Attributes.pod b/lib/Moose/Manual/Attributes.pod index 174c624..2a49b84 100644 --- a/lib/Moose/Manual/Attributes.pod +++ b/lib/Moose/Manual/Attributes.pod @@ -353,6 +353,7 @@ This is the same as specifying all of these options: has 'size' => ( is => 'ro', + required => 1, lazy => 1, builder => '_build_size', clearer => 'clear_size', @@ -371,6 +372,7 @@ becomes: has '_size' => ( is => 'ro', + required => 1, lazy => 1, builder => '_build__size', clearer => '_clear_size', diff --git a/lib/Moose/Meta/Attribute.pm b/lib/Moose/Meta/Attribute.pm index 8ca92cc..cf10984 100644 --- a/lib/Moose/Meta/Attribute.pm +++ b/lib/Moose/Meta/Attribute.pm @@ -843,6 +843,7 @@ is equivalent to this: has 'size' => ( is => 'ro', + required => 1, lazy => 1, builder => '_build_size', clearer => 'clear_size',