summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authordoy <doy@tozt.net>2009-04-10 02:10:53 -0500
committerdoy <doy@tozt.net>2009-04-10 02:10:53 -0500
commit9c80a3d3f83f9d7f09d001564d6352238e871ebf (patch)
tree760a5f76c043c9f3599a48fa984f82ee9b5ed125 /lib
parent32e195a50b6e424b333d1e2ac94852f0e4a40c8e (diff)
downloadmoosex-nonmoose-9c80a3d3f83f9d7f09d001564d6352238e871ebf.tar.gz
moosex-nonmoose-9c80a3d3f83f9d7f09d001564d6352238e871ebf.zip
add a few comments
Diffstat (limited to 'lib')
-rw-r--r--lib/MooseX/NonMoose.pm6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/MooseX/NonMoose.pm b/lib/MooseX/NonMoose.pm
index b03c2cd..db2e385 100644
--- a/lib/MooseX/NonMoose.pm
+++ b/lib/MooseX/NonMoose.pm
@@ -20,9 +20,15 @@ sub extends_nonmoose {
$meta->add_method(new => sub {
my $class = shift;
my $meta = Class::MOP::Class->initialize($class);
+
+ # we need to get the non-moose constructor from the superclass
+ # of the class where this method actually exists
my $caller_meta = Class::MOP::Class->initialize($caller);
my $super_new = $caller_meta->find_next_method_by_name('new');
+ # but we need to call it as a method on the class we're actually
+ # trying to instantiate
my $self = $super_new->execute($class, @_);
+
my $params = $class->BUILDARGS(@_);
my $moose_self = $meta->new_object(
__INSTANCE__ => $self,