X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMoose%2FManual%2FClasses.pod;h=5619db33c5c75f95630c61a651654b2eb6224517;hb=079191e18e51457fea4cf4b10fecca653660f02c;hp=f2cd3972dd064875958c66eacc4fd748acbe0f45;hpb=1a5d5ecd3f4f760db9974b785b1c6933b14fb020;p=gitmo%2FMoose.git diff --git a/lib/Moose/Manual/Classes.pod b/lib/Moose/Manual/Classes.pod index f2cd397..5619db3 100644 --- a/lib/Moose/Manual/Classes.pod +++ b/lib/Moose/Manual/Classes.pod @@ -31,12 +31,12 @@ example, you might define an attribute ... Attributes are described in the L documentation. -Loading Moose also turns enables C and C pragmas in -your class. +Loading Moose also enables C and C pragmas in your +class. When you load Moose, your class will become a subclass of L. The L class provides a default -constructor, destructor, as well as object construction helper +constructor and destructor, as well as object construction helper methods. You can read more about this in the L document. @@ -83,6 +83,14 @@ namespace. We recommend that you take advantage of this feature, since it just makes your classes "cleaner". You can do this by simply adding C at the end of your module file. + package Person; + + use Moose; + + has 'ssn' => ( is => 'rw' ); + + no Moose; + This deletes Moose's sugar functions from your class's namespace, so that C<< Person->can('has') >> will no longer return true. @@ -107,8 +115,8 @@ class's metaclass object. If you override C in your class, then the immutabilization code will not be able to provide an optimized constructor for your -class. Instead, you should use C method, which will be called -from the inlined constructor. +class. Instead, you should use a C method, which will be +called from the inlined constructor. Alternately, if you really need to provide a different C, you can also provide your own immutabilization method. Doing so requires