From: Shawn M Moore Date: Wed, 27 May 2009 00:10:19 +0000 (-0400) Subject: Mouse::class_of X-Git-Tag: 0.23~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=aa1bb1ab26d854faa03e05afaaa9614b660280c6;p=gitmo%2FMouse.git Mouse::class_of --- diff --git a/lib/Mouse.pm b/lib/Mouse.pm index 9c880ee..22792c9 100644 --- a/lib/Mouse.pm +++ b/lib/Mouse.pm @@ -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__