Make class_of actually work, since it's not a method! :x
Shawn M Moore [Sat, 28 Mar 2009 19:54:20 +0000 (15:54 -0400)]
lib/Class/MOP.pm

index e99cc24..97e326c 100644 (file)
@@ -137,13 +137,9 @@ sub _is_valid_class_name {
 }
 
 sub class_of {
-    my $self  = shift;
-    my $class = shift;
+    my $class = blessed($_[0]) || $_[0];
 
     return undef if !defined($class);
-
-    $class = blessed($class) || $class;
-
     return get_metaclass_by_name($class);
 }