Mouse::class_of
Shawn M Moore [Wed, 27 May 2009 00:10:19 +0000 (20:10 -0400)]
lib/Mouse.pm

index 9c880ee..22792c9 100644 (file)
@@ -191,6 +191,12 @@ sub is_class_loaded {
     return 0;
 }
 
+sub class_of {
+    return unless defined $_[0];
+    my $class = blessed($_[0]) || $_[0];
+    return Mouse::Meta::Class::get_metaclass_by_name($class);
+}
+
 1;
 
 __END__