--- trunk/lib/Frey/ClassLoader.pm 2008/11/18 12:55:32 408 +++ trunk/lib/Frey/ClassLoader.pm 2008/11/18 14:01:20 411 @@ -126,7 +126,12 @@ =head2 class_methods - my @methods = $o->class_methods( $class ); + my @all_methods = $o->class_methods( $class ); + + my $class_method = $o->class_methods( $class ); + if ( $class_method->{ $method } ) { + # $class has $method + } =cut @@ -135,18 +140,19 @@ confess "need class" unless $class; if ( ! $class->can('meta') ) { - warn "$class doesn't have meta (isn't Moose class)"; + warn "$class doesn't have meta (isn't Moose class)" if $self->debug; return; } my $meta = $class->meta; my $attr; + my $methods; $attr->{$_}++ foreach $meta->get_attribute_list; - my @methods = grep { ! defined($attr->{$_}) } $meta->get_method_list; + my @methods = map { $methods->{$_}++; $_ } grep { ! defined($attr->{$_}) && $_ ne 'meta' } $meta->get_method_list; warn "# methods = ",dump( @methods ) if $self->debug; - return @methods; + return @methods if wantarray; + return $methods; } - 1;