From 9383dbbb73b64be0254a4b59a1bb61fb7fc783b7 Mon Sep 17 00:00:00 2001 From: Jason May Date: Wed, 6 May 2009 13:35:18 -0400 Subject: provide doc for FOREIGNBUILDARGS --- lib/MooseX/NonMoose.pm | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/MooseX/NonMoose.pm b/lib/MooseX/NonMoose.pm index 62bf0d5..5f66ffe 100644 --- a/lib/MooseX/NonMoose.pm +++ b/lib/MooseX/NonMoose.pm @@ -59,6 +59,20 @@ about inlining, this is all you need to worry about. Applying L as well will provide an inlined constructor when you immutabilize your class. +MooseX::NonMoose provides a way to manipulate the argument list that gets +passed to the superclass constructor: FOREIGNBUILDARGS. This supports setting +attributes in the constructor for a subclass of a class whose constructor does +strict argument checking. + + sub FOREIGNBUILDARGS { + my $class = shift; + my %args = @_; + + # Returns a list that is appropriate for what you would + # use for arguments in the superclass constructor. + return massage_for_baseclass_args(%args); + } + =cut Moose::Exporter->setup_import_methods; @@ -80,10 +94,6 @@ sub init_meta { =over 4 -=item * Provide some way to manipulate the argument list that gets passed to the -superclass constructor, to support setting attributes in the constructor for a -subclass of a class whose constructor does strict argument checking. - =item * Allow for constructors with names other than C. =back -- cgit v1.2.3-54-g00ecf