* Tests
- Add test showing how the xs Class::MOP::is_class_loaded can
be made to operate differently to the pure perl version (t0m)
+ * Class::MOP::Class
+ - Add get_all_method_names (Sartak)
0.75 Wed, December 31, 2008
* Class::MOP::Class
} shift->get_all_methods(@_);
}
+sub get_all_method_names {
+ my $self = shift;
+ my %uniq;
+ grep { $uniq{$_}++ == 0 } map { $_->name } $self->get_all_methods;
+}
+
sub find_all_methods_by_name {
my ($self, $method_name) = @_;
(defined $method_name && $method_name)
class_precedence_list => 'ARRAY',
linearized_isa => 'ARRAY', # FIXME perl 5.10 memoizes this on its own, no need?
get_all_methods => 'ARRAY',
+ get_all_method_names => 'ARRAY',
#get_all_attributes => 'ARRAY', # it's an alias, no need, but maybe in the future
compute_all_applicable_attributes => 'ARRAY',
get_meta_instance => 'SCALAR',
Use L<get_all_methods>, which is easier/better/faster. This method predates
L<Class::MOP::Method>.
+=item B<get_all_method_names>
+
+This will traverse the inheritance heirachy and return a list of all the
+applicable method names for this class. Duplicate names are removed, but the
+order the methods come out is not defined.
+
=item B<find_all_methods_by_name ($method_name)>
This will traverse the inheritence hierarchy and locate all methods
use strict;
use warnings;
-use Test::More tests => 234;
+use Test::More tests => 236;
use Test::Exception;
use Class::MOP;
superclasses subclasses class_precedence_list linearized_isa
has_method get_method add_method remove_method alias_method wrap_method_body
- get_method_list get_method_map get_all_methods compute_all_applicable_methods
+ get_method_list get_method_map get_all_method_names get_all_methods compute_all_applicable_methods
find_method_by_name find_all_methods_by_name find_next_method_by_name
add_before_method_modifier add_after_method_modifier add_around_method_modifier