From: Dave Rolsky Date: Mon, 16 Mar 2009 05:06:23 +0000 (-0500) Subject: Fixed the scrwed up the list of methods which are not document for X-Git-Tag: 0.78_01~25 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4054ae3156b89545d82263482430577476461791;p=gitmo%2FClass-MOP.git Fixed the scrwed up the list of methods which are not document for CMOP::Class. Add docs for add_method and remove_method --- diff --git a/lib/Class/MOP/Class.pm b/lib/Class/MOP/Class.pm index 6a049b8..6bc3e36 100644 --- a/lib/Class/MOP/Class.pm +++ b/lib/Class/MOP/Class.pm @@ -1419,6 +1419,27 @@ This method returns the first method in any superclass matching the given name. It is effectively the method that C would dispatch to. +=item B<< $metaclass->add_method($method_name, $method) >> + +This method takes a method name and a subroutine reference, and adds +the method to the class. + +The subroutine reference can be a L, and you are +strongly encouraged to pass a meta method object instead of a code +reference. If you do so, that object gets stored as part of the +class's method map directly. If not, the meta information will have to +be recreated later, and may be incorrect. + +If you provide a method object, this method will clone that object if +the object's package name does not match the class name. This lets us +track the original source of any methods added from other classes +(notably Moose roles). + +=item B<< $metaclass->remove_method($method_name) >> + +Remove the named method from the class. This method returns the +L object for the method. + =back =head2 Attribute introspection and creation diff --git a/xt/pod_coverage.t b/xt/pod_coverage.t index e017055..70e6585 100644 --- a/xt/pod_coverage.t +++ b/xt/pod_coverage.t @@ -16,16 +16,34 @@ plan tests => scalar @modules; my %trustme = ( 'Class::MOP::Attribute' => ['process_accessors'], 'Class::MOP::Class' => [ - qw( reset_package_cache_flag update_package_cache_flag - add_meta_instance_dependencies remove_meta_instance_dependencies - update_meta_instance_dependencies add_dependent_meta_instance - remove_dependent_meta_instance invalidate_meta_instances - invalidate_meta_instance - construct_instance - clone_instance - compute_all_applicable_methods - alias_method - ) + # deprecated + 'alias_method', + 'compute_all_applicable_methods', + + # unfinished feature + 'add_dependent_meta_instance', + 'add_meta_instance_dependencies', + 'invalidate_meta_instance', + 'invalidate_meta_instances', + 'remove_dependent_meta_instance', + 'remove_meta_instance_dependencies', + 'update_meta_instance_dependencies', + + # effectively internal + 'check_metaclass_compatibility', + 'clone_instance', + 'construct_class_instance', + 'construct_instance', + 'create_immutable_transformer', + 'create_meta_instance', + 'get_immutable_options', + 'reset_package_cache_flag', + 'update_package_cache_flag', + 'wrap_method_body', + + # doc'd under get_all_attributes + 'compute_all_applicable_attributes', + ], );