From: Hans Dieter Pearcey Date: Thu, 25 Jun 2009 18:58:15 +0000 (-0400) Subject: add documentation X-Git-Tag: 0.89_02~138^2^2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9218b114a26bb4f6da676bb2fcbec94fc824929d;p=gitmo%2FMoose.git add documentation --- diff --git a/Changes b/Changes index 2ce1839..bce5ce1 100644 --- a/Changes +++ b/Changes @@ -7,6 +7,7 @@ for, noteworthy changes. associated methods, it will give a deprecation warning. (hdp) - Methods generated by delegation were not being added to associated_methods. (hdp) + - Move currying syntax for delegation in from AttributeHelpers. (hdp) * Moose::Util::TypeConstraints * Moose::Meta::TypeConstraint::DuckType diff --git a/lib/Moose.pm b/lib/Moose.pm index ea6b6c2..15cf38b 100644 --- a/lib/Moose.pm +++ b/lib/Moose.pm @@ -543,6 +543,18 @@ In this example, the Tree package gets C and C methods, which delegate to the C and C methods (respectively) of the Tree instance stored in the C slot. +You may also use an array reference to curry arguments to the original method. + + has 'thing' => ( + ... + handles => { set_foo => [ set => [ 'foo' ] ] }, + ); + + # $self->set_foo(...) calls $self->thing->set('foo', ...) + +The first element of the array reference is the original method name, and the +second is an array reference of curried arguments. + =item C The regexp option works very similar to the ARRAY option, except that it builds