X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMoose.pm;h=78d4239e6616b2bccc7a54be2ce6de3c4d55da7b;hb=dd3ac8f94d9b58bde82976f329e24a41dbd86736;hp=12a7e4981e19140f4043e16d7d9ce5de73b28b07;hpb=a6f9a6cd26513ba2457f5b54bab12bee84bca5a1;p=gitmo%2FMoose.git diff --git a/lib/Moose.pm b/lib/Moose.pm index 12a7e49..78d4239 100644 --- a/lib/Moose.pm +++ b/lib/Moose.pm @@ -4,7 +4,7 @@ use warnings; use 5.008; -our $VERSION = '0.93_02'; +our $VERSION = '1.04'; $VERSION = eval $VERSION; our $AUTHORITY = 'cpan:STEVAN'; @@ -403,10 +403,31 @@ actually Ces onto the class's C<@ISA>, whereas C will replace it. This is important to ensure that classes which do not have superclasses still properly inherit from L. +Each superclass can be followed by a hash reference with options. Currently, +only L<-version|Class::MOP/Class Loading Options> is recognized: + + extends 'My::Parent' => { -version => 0.01 }, + 'My::OtherParent' => { -version => 0.03 }; + +An exception will be thrown if the version requirements are not +satisfied. + =item B This will apply a given set of C<@roles> to the local class. +Like with C, each specified role can be followed by a hash +reference with a L<-version|Class::MOP/Class Loading Options> option: + + with 'My::Role' => { -version => 0.32 }, + 'My::Otherrole' => { -version => 0.23 }; + +The specified version requirements must be satisfied, otherwise an +exception will be thrown. + +If your role takes options or arguments, they can be passed along in the +hash reference as well. + =item B %options> This will install an attribute of a given C<$name> into the current class. If @@ -482,9 +503,9 @@ either C or C. =item I $code> The I option is a CODE reference which will be called after -the value of the attribute is set. The CODE ref will be passed the -instance itself and the updated value. If the attribute already had a -value, this will be passed as the third value to the trigger. +the value of the attribute is set. The CODE ref is passed the +instance itself, the updated value, and the original value if the +attribute was already set. You B have a trigger on a read-only attribute. @@ -492,7 +513,7 @@ B Triggers will only fire when you B to the attribute, either in the constructor, or using the writer. Default and built values will B cause the trigger to be fired. -=item I ARRAY | HASH | REGEXP | ROLE | DUCKTYPE | CODE> +=item I ARRAY | HASH | REGEXP | ROLE | ROLETYPE | DUCKTYPE | CODE> The I option provides Moose classes with automated delegation features. This is a pretty complex and powerful option. It accepts many different option @@ -588,13 +609,14 @@ B An I option is required when using the regexp option format. This is so that we can determine (at compile time) the method list from the class. Without an I this is just not possible. -=item C +=item C or C -With the role option, you specify the name of a role whose "interface" then -becomes the list of methods to handle. The "interface" can be defined as; the -methods of the role and any required methods of the role. It should be noted -that this does B include any method modifiers or generated attribute -methods (which is consistent with role composition). +With the role option, you specify the name of a role or a +L whose "interface" then becomes +the list of methods to handle. The "interface" can be defined as; the methods +of the role and any required methods of the role. It should be noted that this +does B include any method modifiers or generated attribute methods (which +is consistent with role composition). =item C @@ -804,11 +826,11 @@ B overridden, or removed. =back -=item B sub { ... }> +=item B sub { ... }> -=item B sub { ... }> +=item B sub { ... }> -=item B sub { ... }> +=item B sub { ... }> These three items are syntactic sugar for the before, after, and around method modifier features that L provides. More information on these may be @@ -1061,7 +1083,7 @@ early ideas/feature-requests/encouragement/bug-finding. =item L -This is the official web home of Moose, it contains links to our public SVN repository +This is the official web home of Moose, it contains links to our public git repository as well as links to a number of talks and articles on Moose and Moose related technologies.