Merge branch 'attribute_helpers'
Hans Dieter Pearcey [Wed, 2 Sep 2009 15:15:03 +0000 (11:15 -0400)]
1  2 
Changes
lib/Moose.pm
xt/author/pod_coverage.t

diff --combined Changes
+++ b/Changes
@@@ -1,11 -1,18 +1,20 @@@
  Also see Moose::Manual::Delta for more details of, and workarounds
  for, noteworthy changes.
  
+     * Moose::Meta::Attribute
+       - Added the currying syntax for delegation from AttributeHelpers
+         to the existing delegation API. (hdp)
+     * Moose::Meta::Attribute::Native
+       - Moved in from MooseX::AttributeHelpers with API tweaks. See
+         Moose::Manual::Delta for details. (hdp, jhannah, rbuels, Sartak,
+         perigrin, doy)
      * Moose::Error::Croak
      * Moose::Error::Confess
        - Clarify documentation on how to use. (Curtis Jewell)
 +    * Moose
 +      - Correct POD for builder to point to Recipe8, not 9. (gphat)
  
  0.89 Thu Aug 13, 2009
      * Moose::Manual::Attributes
diff --combined lib/Moose.pm
@@@ -34,6 -34,8 +34,8 @@@ use Moose::Meta::Role::Application::ToI
  use Moose::Util::TypeConstraints;
  use Moose::Util ();
  
+ use Moose::Meta::Attribute::Native;
  sub throw_error {
      # FIXME This
      shift;
@@@ -540,6 -542,18 +542,18 @@@ In this example, the Tree package gets 
  which delegate to the C<node> and C<children> methods (respectively) of the Tree
  instance stored in the C<parent> 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
+ rest is a list of curried arguments.
  =item C<REGEXP>
  
  The regexp option works very similar to the ARRAY option, except that it builds
@@@ -607,7 -621,7 +621,7 @@@ example
  The value of this key is the name of the method that will be called to
  obtain the value used to initialize the attribute. See the L<builder
  option docs in Class::MOP::Attribute|Class::MOP::Attribute/builder>
 - and/or L<Moose::Cookbook::Basics::Recipe9> for more information.
 + and/or L<Moose::Cookbook::Basics::Recipe8> for more information.
  
  =item I<default> => SCALAR | CODE
  
diff --combined xt/author/pod_coverage.t
@@@ -14,12 -14,18 +14,17 @@@ my @modules = all_modules()
  plan tests => scalar @modules;
  
  my %trustme = (
 -    'Moose'                  => ['make_immutable'],
      'Moose::Meta::Attribute' => [
          qw( interpolate_class
              throw_error
              attach_to_class
              )
      ],
+     'Moose::Meta::Attribute::Native::MethodProvider::Array'   => ['.+'],
+     'Moose::Meta::Attribute::Native::MethodProvider::Bool'    => ['.+'],
+     'Moose::Meta::Attribute::Native::MethodProvider::Counter' => ['.+'],
+     'Moose::Meta::Attribute::Native::MethodProvider::Hash'    => ['.+'],
+     'Moose::Meta::Attribute::Native::MethodProvider::String'  => ['.+'],
      'Moose::Meta::Class'     => [
          qw( check_metaclass_compatibility
              construct_instance
@@@ -67,6 -73,7 +72,6 @@@
              extends
              has
              inner
 -            make_immutable
              override
              super
              with )