X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Fmetaclass.pm;h=819bdac359c783b00dffe88e86219d4f64ede4d0;hb=222860635b059db73389c69475bccc62dfa753a4;hp=39fea4b41a23f88fed4a00c9c73c33ace1b7f8b6;hpb=013b1897ada42ebdd970371868cc3679d3a49344;p=gitmo%2FClass-MOP.git diff --git a/lib/metaclass.pm b/lib/metaclass.pm index 39fea4b..819bdac 100644 --- a/lib/metaclass.pm +++ b/lib/metaclass.pm @@ -4,9 +4,10 @@ package metaclass; use strict; use warnings; -use Carp 'confess'; +use Carp 'confess'; +use Scalar::Util 'blessed'; -our $VERSION = '0.01'; +our $VERSION = '0.02'; use Class::MOP; @@ -27,7 +28,7 @@ sub import { # since metaclass instances are # singletons, this is not really a # big deal anyway. - $metaclass->initialize($_[0] => %options) + $metaclass->initialize((blessed($_[0]) || $_[0]) => %options) }); }