From: Stevan Little Date: Wed, 21 Feb 2007 03:05:23 +0000 (+0000) Subject: Lots of doc updates X-Git-Tag: 0_37~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2367814a108bbb85efbf76b57fc58bf464d68455;p=gitmo%2FClass-MOP.git Lots of doc updates --- diff --git a/Changes b/Changes index 05ac1b0..10056fa 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,8 @@ Revision history for Perl extension Class-MOP. 0.37 + ~~ Many documentation updates ~~ + * Class::MOP::Attribute - default now checks the instance with defined to avoid setting off bool-overloads (found by Carl Franks) diff --git a/README b/README index a0afd06..ad3f01d 100644 --- a/README +++ b/README @@ -23,7 +23,7 @@ This module requires these other modules and libraries: COPYRIGHT AND LICENCE -Copyright (C) 2006 Infinity Interactive, Inc. +Copyright (C) 2006, 2007 Infinity Interactive, Inc. http://www.iinteractive.com diff --git a/examples/ArrayBasedStorage.pod b/examples/ArrayBasedStorage.pod index 1c23505..cd4dc1e 100644 --- a/examples/ArrayBasedStorage.pod +++ b/examples/ArrayBasedStorage.pod @@ -104,7 +104,7 @@ Yuval Kogman Enothingmuch@woobling.comE =head1 COPYRIGHT AND LICENSE -Copyright 2006 by Infinity Interactive, Inc. +Copyright 2006, 2007 by Infinity Interactive, Inc. L diff --git a/examples/AttributesWithHistory.pod b/examples/AttributesWithHistory.pod index 6365e79..5a91923 100644 --- a/examples/AttributesWithHistory.pod +++ b/examples/AttributesWithHistory.pod @@ -126,7 +126,7 @@ Yuval Kogman Enothingmuch@woobling.comE =head1 COPYRIGHT AND LICENSE -Copyright 2006 by Infinity Interactive, Inc. +Copyright 2006, 2007 by Infinity Interactive, Inc. L diff --git a/examples/C3MethodDispatchOrder.pod b/examples/C3MethodDispatchOrder.pod index 18ad9e3..5623137 100644 --- a/examples/C3MethodDispatchOrder.pod +++ b/examples/C3MethodDispatchOrder.pod @@ -129,7 +129,7 @@ Yuval Kogman Enothingmuch@woobling.comE =head1 COPYRIGHT AND LICENSE -Copyright 2006 by Infinity Interactive, Inc. +Copyright 2006, 2007 by Infinity Interactive, Inc. L diff --git a/examples/ClassEncapsulatedAttributes.pod b/examples/ClassEncapsulatedAttributes.pod index c869dd5..c3c71eb 100644 --- a/examples/ClassEncapsulatedAttributes.pod +++ b/examples/ClassEncapsulatedAttributes.pod @@ -141,7 +141,7 @@ Yuval Kogman Enothingmuch@woobling.comE =head1 COPYRIGHT AND LICENSE -Copyright 2006 by Infinity Interactive, Inc. +Copyright 2006, 2007 by Infinity Interactive, Inc. L diff --git a/examples/InsideOutClass.pod b/examples/InsideOutClass.pod index e106113..1018c0b 100644 --- a/examples/InsideOutClass.pod +++ b/examples/InsideOutClass.pod @@ -185,7 +185,7 @@ Yuval Kogman Enothingmuch@woobling.comE =head1 COPYRIGHT AND LICENSE -Copyright 2006 by Infinity Interactive, Inc. +Copyright 2006, 2007 by Infinity Interactive, Inc. L diff --git a/examples/InstanceCountingClass.pod b/examples/InstanceCountingClass.pod index d0274e7..b3fbac5 100644 --- a/examples/InstanceCountingClass.pod +++ b/examples/InstanceCountingClass.pod @@ -63,7 +63,7 @@ Yuval Kogman Enothingmuch@woobling.comE =head1 COPYRIGHT AND LICENSE -Copyright 2006 by Infinity Interactive, Inc. +Copyright 2006, 2007 by Infinity Interactive, Inc. L diff --git a/examples/LazyClass.pod b/examples/LazyClass.pod index 7c9d00a..839b609 100644 --- a/examples/LazyClass.pod +++ b/examples/LazyClass.pod @@ -153,7 +153,7 @@ Yuval Kogman Enothingmuch@woobling.comE =head1 COPYRIGHT AND LICENSE -Copyright 2006 by Infinity Interactive, Inc. +Copyright 2006, 2007 by Infinity Interactive, Inc. L diff --git a/examples/Perl6Attribute.pod b/examples/Perl6Attribute.pod index bb8047e..a5bc8fd 100644 --- a/examples/Perl6Attribute.pod +++ b/examples/Perl6Attribute.pod @@ -73,7 +73,7 @@ Yuval Kogman Enothingmuch@woobling.comE =head1 COPYRIGHT AND LICENSE -Copyright 2006 by Infinity Interactive, Inc. +Copyright 2006, 2007 by Infinity Interactive, Inc. L diff --git a/lib/Class/MOP.pm b/lib/Class/MOP.pm index a4c9f04..9b341f7 100644 --- a/lib/Class/MOP.pm +++ b/lib/Class/MOP.pm @@ -829,7 +829,7 @@ Yuval Kogman Enothingmuch@woobling.comE =head1 COPYRIGHT AND LICENSE -Copyright 2006 by Infinity Interactive, Inc. +Copyright 2006, 2007 by Infinity Interactive, Inc. L diff --git a/lib/Class/MOP/Attribute.pm b/lib/Class/MOP/Attribute.pm index 2935d35..941f90a 100644 --- a/lib/Class/MOP/Attribute.pm +++ b/lib/Class/MOP/Attribute.pm @@ -262,6 +262,11 @@ sub install_accessors { sub remove_accessors { my $self = shift; + # TODO: + # we really need to make sure to remove from the + # associates methods here as well. But this is + # such a slimly used method, I am not worried + # about it right now. $_remove_accessor->($self->accessor(), $self->associated_class()) if $self->has_accessor(); $_remove_accessor->($self->reader(), $self->associated_class()) if $self->has_reader(); $_remove_accessor->($self->writer(), $self->associated_class()) if $self->has_writer(); @@ -445,6 +450,12 @@ back to their "unfulfilled" state. =head2 Value management +These methods are basically "backdoors" to the instance, which can be used +to bypass the regular accessors, but still stay within the context of the MOP. + +These methods are not for general use, and should only be used if you really +know what you are doing. + =over 4 =item B @@ -459,8 +470,15 @@ even to attributes with just write only accessors. =item B +Returns a boolean indicating if the item in the C<$instance> has a value in it. +This is basically what the default C method calls. + =item B +This will clear the value in the C<$instance>. This is basically what the default +C would call. Note that this may be done even if the attirbute does not +have any associated read, write or clear methods. + =back =head2 Informational @@ -523,14 +541,32 @@ These are all basic predicate methods for the values passed into C. =head2 Class association +These methods allow you to manage the attributes association with +the class that contains it. These methods should not be used +lightly, nor are they very magical, they are mostly used internally +and by metaclass instances. + =over 4 =item B +This returns the metaclass this attribute is associated with. + =item B +This will store a weaken reference to C<$class> internally. You should +note that just changing the class assocation will not remove the attribute +from it's old class, and initialize it (and it's accessors) in the new +C<$class>. It is up to you to do this manually. + =item B +This will remove the weakened reference to the class. It does B +remove the attribute itself from the class (or remove it's accessors), +you must do that yourself if you want too. Actually if that is what +you want to do, you should probably be looking at +L instead. + =back =head2 Attribute Accessor generation @@ -539,10 +575,20 @@ These are all basic predicate methods for the values passed into C. =item B -=item B +Accessors are generated by an accessor metaclass, which is usually +a subclass of C. This method returns +the name of the accessor metaclass that this attribute uses. + +=item B + +This will associate a C<$method> with the given attribute which is +used internally by the accessor generator. =item B +This will return the list of methods which have been associated with +the C methods. + =item B This allows the attribute to generate and install code for it's own @@ -566,6 +612,9 @@ This allows the attribute to remove the method for it's own I. This is called by C. +NOTE: This does not currently remove methods from the list returned +by C, that is on the TODO list. + =back =head2 Introspection @@ -592,7 +641,7 @@ Yuval Kogman Enothingmuch@woobling.comE =head1 COPYRIGHT AND LICENSE -Copyright 2006 by Infinity Interactive, Inc. +Copyright 2006, 2007 by Infinity Interactive, Inc. L diff --git a/lib/Class/MOP/Class.pm b/lib/Class/MOP/Class.pm index f5e9f8d..bde5f52 100644 --- a/lib/Class/MOP/Class.pm +++ b/lib/Class/MOP/Class.pm @@ -1313,7 +1313,7 @@ Yuval Kogman Enothingmuch@woobling.comE =head1 COPYRIGHT AND LICENSE -Copyright 2006 by Infinity Interactive, Inc. +Copyright 2006, 2007 by Infinity Interactive, Inc. L diff --git a/lib/Class/MOP/Immutable.pm b/lib/Class/MOP/Immutable.pm index 1af082a..72a577a 100644 --- a/lib/Class/MOP/Immutable.pm +++ b/lib/Class/MOP/Immutable.pm @@ -226,7 +226,7 @@ Stevan Little Estevan@iinteractive.comE =head1 COPYRIGHT AND LICENSE -Copyright 2006 by Infinity Interactive, Inc. +Copyright 2006, 2007 by Infinity Interactive, Inc. L diff --git a/lib/Class/MOP/Instance.pm b/lib/Class/MOP/Instance.pm index 89ea9c8..5af57b3 100644 --- a/lib/Class/MOP/Instance.pm +++ b/lib/Class/MOP/Instance.pm @@ -328,7 +328,7 @@ Stevan Little Estevan@iinteractive.comE =head1 COPYRIGHT AND LICENSE -Copyright 2006 by Infinity Interactive, Inc. +Copyright 2006, 2007 by Infinity Interactive, Inc. L diff --git a/lib/Class/MOP/Method.pm b/lib/Class/MOP/Method.pm index 55b22fb..8064c22 100644 --- a/lib/Class/MOP/Method.pm +++ b/lib/Class/MOP/Method.pm @@ -133,7 +133,7 @@ Yuval Kogman Enothingmuch@woobling.comE =head1 COPYRIGHT AND LICENSE -Copyright 2006 by Infinity Interactive, Inc. +Copyright 2006, 2007 by Infinity Interactive, Inc. L diff --git a/lib/Class/MOP/Method/Accessor.pm b/lib/Class/MOP/Method/Accessor.pm index 1c03e31..7087047 100644 --- a/lib/Class/MOP/Method/Accessor.pm +++ b/lib/Class/MOP/Method/Accessor.pm @@ -234,7 +234,7 @@ Stevan Little Estevan@iinteractive.comE =head1 COPYRIGHT AND LICENSE -Copyright 2006 by Infinity Interactive, Inc. +Copyright 2006, 2007 by Infinity Interactive, Inc. L diff --git a/lib/Class/MOP/Method/Constructor.pm b/lib/Class/MOP/Method/Constructor.pm index 7e389db..fcff479 100644 --- a/lib/Class/MOP/Method/Constructor.pm +++ b/lib/Class/MOP/Method/Constructor.pm @@ -165,7 +165,7 @@ Stevan Little Estevan@iinteractive.comE =head1 COPYRIGHT AND LICENSE -Copyright 2006 by Infinity Interactive, Inc. +Copyright 2006, 2007 by Infinity Interactive, Inc. L diff --git a/lib/Class/MOP/Method/Wrapped.pm b/lib/Class/MOP/Method/Wrapped.pm index ba1451b..68ad0a2 100644 --- a/lib/Class/MOP/Method/Wrapped.pm +++ b/lib/Class/MOP/Method/Wrapped.pm @@ -183,7 +183,7 @@ Yuval Kogman Enothingmuch@woobling.comE =head1 COPYRIGHT AND LICENSE -Copyright 2006 by Infinity Interactive, Inc. +Copyright 2006, 2007 by Infinity Interactive, Inc. L diff --git a/lib/Class/MOP/Module.pm b/lib/Class/MOP/Module.pm index 1611362..d992080 100644 --- a/lib/Class/MOP/Module.pm +++ b/lib/Class/MOP/Module.pm @@ -81,7 +81,7 @@ Yuval Kogman Enothingmuch@woobling.comE =head1 COPYRIGHT AND LICENSE -Copyright 2006 by Infinity Interactive, Inc. +Copyright 2006, 2007 by Infinity Interactive, Inc. L diff --git a/lib/Class/MOP/Object.pm b/lib/Class/MOP/Object.pm index e20e299..49ae865 100644 --- a/lib/Class/MOP/Object.pm +++ b/lib/Class/MOP/Object.pm @@ -93,7 +93,7 @@ Stevan Little Estevan@iinteractive.comE =head1 COPYRIGHT AND LICENSE -Copyright 2006 by Infinity Interactive, Inc. +Copyright 2006, 2007 by Infinity Interactive, Inc. L diff --git a/lib/Class/MOP/Package.pm b/lib/Class/MOP/Package.pm index 912072b..15ccfd6 100644 --- a/lib/Class/MOP/Package.pm +++ b/lib/Class/MOP/Package.pm @@ -276,7 +276,7 @@ Yuval Kogman Enothingmuch@woobling.comE =head1 COPYRIGHT AND LICENSE -Copyright 2006 by Infinity Interactive, Inc. +Copyright 2006, 2007 by Infinity Interactive, Inc. L diff --git a/lib/metaclass.pm b/lib/metaclass.pm index e1bd16a..56d8475 100644 --- a/lib/metaclass.pm +++ b/lib/metaclass.pm @@ -88,7 +88,7 @@ Yuval Kogman Enothingmuch@woobling.comE =head1 COPYRIGHT AND LICENSE -Copyright 2006 by Infinity Interactive, Inc. +Copyright 2006, 2007 by Infinity Interactive, Inc. L