Class::MOP - A Meta Object Protocol for Perl 5
-=head1 SYNOPSIS
-
- # ... This will come later, for now see
- # the other SYNOPSIS for more information
-
=head1 DESCRIPTON
This module is an attempt to create a meta object protocol for the
=back
-=head2 Article
+=head2 Articles
=over 4
=item B<is_anon_class>
+This returns true if the class is a C<Class::MOP::Class> created anon class.
+
=item B<is_mutable>
+This returns true if the class is still mutable.
+
=item B<is_immutable>
+This returns true if the class has been made immutable.
+
=back
=head2 Inheritance Relationships
=back
-=head2 Class closing
+=head2 Class Immutability
=over 4
-=item B<make_immutable>
+=item B<make_immutable (%options)>
+
+This method will invoke a tranforamtion upon the class which will
+make it immutable. Details of this transformation can be found in
+the L<Class::MOP::Immutable> documentation.
=back
=head1 SYNOPSIS
+ use Class::MOP::Immutable;
+
+ my $immutable_metaclass = Class::MOP::Immutable->new($metaclass, {
+ read_only => [qw/superclasses/],
+ cannot_call => [qw/
+ add_method
+ alias_method
+ remove_method
+ add_attribute
+ remove_attribute
+ add_package_symbol
+ remove_package_symbol
+ /],
+ memoize => {
+ class_precedence_list => 'ARRAY',
+ compute_all_applicable_attributes => 'ARRAY',
+ get_meta_instance => 'SCALAR',
+ get_method_map => 'SCALAR',
+ }
+ });
+
+ $immutable_metaclass->make_metaclass_immutable(@_)
+
=head1 DESCRIPTION
+This is basically a module for applying a transformation on a given
+metaclass. Current features include making methods read-only,
+making methods un-callable and memoizing methods (in a type specific
+way too).
+
+This module is fairly new to the MOP, and quite possibly will be
+expanded and further generalized as the need arises.
+
=head1 METHODS
=over 4
-=item B<new>
-
+=item B<new ($metaclass, \%options)>
+
+Given a C<$metaclass> and a set of C<%options> this module will
+prepare an immutable version of the C<$metaclass>, which can then
+be applied to the C<$metaclass> using the C<make_metaclass_immutable>
+method.
+
=item B<options>
+Returns the options HASH set in C<new>.
+
=item B<metaclass>
+Returns the metaclass set in C<new>.
+
=item B<immutable_metaclass>
+Returns the immutable metaclass created within C<new>.
+
=back
=over 4
=item B<create_immutable_metaclass>
+This will create the immutable version of the C<$metaclass>, but will
+not actually change the original metaclass.
+
=item B<create_methods_for_immutable_metaclass>
+This will create all the methods for the immutable metaclass based
+on the C<%options> passed into C<new>.
+
=item B<make_metaclass_immutable>
+This will actually change the C<$metaclass> into the immutable version.
+
=back
=head1 AUTHORS
=head1 SYNOPSIS
- # ... more to come later maybe
+ use Class::MOP::Method::Accessor;
+
+ my $reader = Class::MOP::Method::Accessor->new(
+ attribute => $attribute,
+ is_inline => 1,
+ accessor_type => 'reader',
+ );
+
+ $reader->body->($instance); # call the reader method
=head1 DESCRIPTION
+This is a C<Class::MOP::Method> subclass which is used interally
+by C<Class::MOP::Attribute> to generate accessor code. It can
+handle generation of readers, writers, predicate and clearer
+methods, both as closures and as more optimized inline methods.
+
=head1 METHODS
=over 4
-=item B<new>
+=item B<new (%options)>
-=item B<intialize_body>
+This creates the method based on the criteria in C<%options>,
+these options are:
+
+=over 4
+
+=item I<attribute>
+
+This must be an instance of C<Class::MOP::Attribute> which this
+accessor is being generated for. This paramter is B<required>.
+
+=item I<accessor_type>
+
+This is a string from the following set; reader, writer, accessor,
+predicate or clearer. This is used to determine which type of
+method is to be generated.
+
+=item I<is_inline>
+
+This is a boolean to indicate if the method should be generated
+as a closure, or as a more optimized inline version.
+
+=back
=item B<accessor_type>
+This returns the accessor type which was passed into C<new>.
+
=item B<is_inline>
+This returns the boolean which was passed into C<new>.
+
=item B<associated_attribute>
+This returns the attribute instance which was passed into C<new>.
+
+=item B<intialize_body>
+
+This will actually generate the method based on the specified
+criteria passed to the constructor.
+
+=back
+
+=head2 Method Generators
+
+These methods will generate appropriate code references for
+the various types of accessors which are supported by
+C<Class::MOP::Attribute>. The names pretty much explain it all.
+
+=over 4
+
=item B<generate_accessor_method>
=item B<generate_accessor_method_inline>
# we don't want this creating
# a cycle in the code, if not
# needed
-# weaken($self->{'$!meta_instance'});
weaken($self->{'$!associated_metaclass'});
$self->intialize_body;
=head1 SYNOPSIS
+ use Class::MOP::Method::Constructor;
+
+ my $constructor = Class::MOP::Method::Constructor->new(
+ metaclass => $metaclass,
+ options => {
+ debug => 1, # this is all for now
+ },
+ );
+
+ # calling the constructor ...
+ $constructor->body->($metaclass->name, %params);
+
=head1 DESCRIPTION
+This is a subclass of C<Class::MOP::Method> which deals with
+class constructors.
+
=head1 METHODS
=over 4
-=item B<new>
+=item B<new (metaclass => $meta, options => \%options)>
-=item B<is_inline>
+=item B<options>
+
+This returns the options HASH which is passed into C<new>.
+
+=item B<associated_metaclass>
+
+This returns the metaclass which is passed into C<new>.
=item B<attributes>
+This returns the list of attributes which are associated with the
+metaclass which is passed into C<new>.
+
=item B<meta_instance>
-=item B<associated_metaclass>
+This returns the meta instance which is associated with the
+metaclass which is passed into C<new>.
-=item B<options>
+=item B<is_inline>
+
+This returns a boolean, but since constructors are very rarely
+not inlined, this always returns true for now.
=item B<intialize_body>
+This creates the code reference for the constructor itself.
+
=back
=head1 AUTHORS
=item B<identifier>
-This constructs a string of the name, version and authrity.
+This constructs a string of the name, version and authority.
=back