From: Shawn M Moore Date: Sun, 10 May 2009 04:34:11 +0000 (-0400) Subject: Make role_for_combination private X-Git-Tag: 0.78~14 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6bdef412cf6c8a3ca414f8bcdd9836744999751b;p=gitmo%2FMoose.git Make role_for_combination private --- diff --git a/Changes b/Changes index 30d8367..05e9996 100644 --- a/Changes +++ b/Changes @@ -29,7 +29,7 @@ for, noteworthy changes. class which isa Moose class with a metaclass role applied (t0m) * Moose::Meta::Role - - Add a role-combination hook, role_for_combination, for the + - Add a role-combination hook, _role_for_combination, for the benefit of MooseX::Role::Parameterized (Sartak) 0.77 Sat, May 2, 2009 diff --git a/lib/Moose/Meta/Role.pm b/lib/Moose/Meta/Role.pm index 0fcfc40..395436d 100644 --- a/lib/Moose/Meta/Role.pm +++ b/lib/Moose/Meta/Role.pm @@ -457,7 +457,7 @@ sub combine { my ($role_name, $params) = @{ splice @role_specs, 0, 1 }; my $requested_role = Class::MOP::class_of($role_name); - my $actual_role = $requested_role->role_for_combination($params); + my $actual_role = $requested_role->_role_for_combination($params); push @roles => $actual_role; next unless defined $params; @@ -472,7 +472,7 @@ sub combine { return $c; } -sub role_for_combination { +sub _role_for_combination { my ($self, $params) = @_; return $self; } @@ -753,12 +753,6 @@ and C keys to control how methods are composed from the role. The return value is a new L that represents the combined roles. -=item B<< Moose::Meta::Role->role_for_combination($options) >> - -This is a hook for incorporating role-combination parameters. This -method returns a role meta-object (by default the invocant role) to be -used for the combination. - =item B<< Moose::Meta::Role->create($name, %options) >> This method is identical to the L C diff --git a/t/030_roles/040_role_for_combination.t b/t/030_roles/040_role_for_combination.t index 302e334..77dc7a2 100644 --- a/t/030_roles/040_role_for_combination.t +++ b/t/030_roles/040_role_for_combination.t @@ -14,7 +14,7 @@ do { use Moose; BEGIN { extends 'Moose::Meta::Role' }; - sub role_for_combination { + sub _role_for_combination { my ($self, $opts) = @_; $OPTS = $opts; return My::Singleton::Role->meta;