Also see Moose::Manual::Delta for more details of, and workarounds
for, noteworthy changes.
-
++0.88
+ * Moose::Meta::Attribute
+ - Added the currying syntax for delegation from AttributeHelpers
+ to the existing delegation API. (hdp)
+
+ * Moose::AttributeHelpers
+ - Moved in from MooseX with API tweaks. See Moose::Manual::Delta for
+ details. (hdp, jhannah, rbuels)
+
+ 0.87 Tue Jul 7, 2009
+ * Moose::Meta::Method::Delegation
+ - Once again allow class names as well as objects for
+ delegation. This was changed in 0.86.
+
+ 0.86 Fri Jul 3, 2009
+ * Moose::Meta::Class::Immutable::Trait
+ - Fixes to work with the latest Class::MOP.
+
+ * Moose::Meta::Method::Delegation
+ - Delegation now dies with a more useful error message if the
+ attribute's accessor returns something defined but
+ unblessed. (hdp)
+
0.85 Fri, Jun 26, 2009
* Moose::Meta::Attribute
- The warning for 'no associated methods' is now split out into
$self->{body} = sub {
my $instance = shift;
my $proxy = $instance->$accessor();
- ( defined $proxy )
- || $self->throw_error(
- "Cannot delegate $handle_name to $method_to_call because "
- . "the value of "
- . $self->associated_attribute->name
- . " is not defined",
- method_name => $method_to_call,
- object => $instance
+
+ my $error
+ = !defined $proxy ? ' is not defined'
+ : ref($proxy) && !blessed($proxy) ? qq{ is not an object (got '$proxy')}
+ : undef;
+
+ if ($error) {
+ $self->throw_error(
+ "Cannot delegate $handle_name to $method_to_call because "
+ . "the value of "
+ . $self->associated_attribute->name
+ . $error,
+ method_name => $method_to_call,
+ object => $instance
);
+ }
-
- $proxy->$method_to_call(@_);
+ my @args = (@{ $self->curried_arguments }, @_);
+ $proxy->$method_to_call(@args);
};
}
use strict;
use warnings;
- use Test::More tests => 89;
-use Test::More tests => 91;
++use Test::More tests => 92;
use Test::Exception;
has 'foo' => (
is => 'rw',
default => sub { Foo->new },
- handles => { 'foo_bar' => 'bar', foo_baz => 'baz' }
+ handles => {
+ 'foo_bar' => 'bar',
++ foo_baz => 'baz',
+ 'foo_bar_to_20' => [ bar => [ 20 ] ],
- }
++ },
);
}