From: Matt S Trout Date: Tue, 26 Jun 2012 18:33:28 +0000 (+0000) Subject: actually commit FakeMetaClass.pm X-Git-Tag: v0.091010~15 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6aff83b400fbf6a72c8f9fffb3c3dc31718315bf;p=gitmo%2FMoo.git actually commit FakeMetaClass.pm --- diff --git a/lib/Moo/HandleMoose/FakeMetaClass.pm b/lib/Moo/HandleMoose/FakeMetaClass.pm new file mode 100644 index 0000000..04db750 --- /dev/null +++ b/lib/Moo/HandleMoose/FakeMetaClass.pm @@ -0,0 +1,20 @@ +package Moo::HandleMoose::FakeMetaClass; + +sub DESTROY { } + +sub AUTOLOAD { + my ($meth) = (our $AUTOLOAD =~ /([^:]+)$/); + require Moo::HandleMoose; + Moo::HandleMoose::inject_real_metaclass_for((shift)->{name})->$meth(@_) +} +sub can { + require Moo::HandleMoose; + Moo::HandleMoose::inject_real_metaclass_for((shift)->{name})->can(@_) +} +sub isa { + require Moo::HandleMoose; + Moo::HandleMoose::inject_real_metaclass_for((shift)->{name})->isa(@_) +} +sub make_immutable { $_[0] } + +1;