my @roles;
foreach my $role($super_meta->meta->calculate_all_roles){
- if(!$self->meta->does_role($role->name)){
+ if(!$self->meta->does_role($role)){
push @roles, $role->name;
}
}
(defined $role_name)
|| $self->throw_error("You must supply a role name to look for");
+ $role_name = $role_name->name if ref $role_name;
+
for my $class ($self->linearized_isa) {
my $meta = Mouse::Util::get_metaclass_by_name($class)
or next;
my $roles = $consumer->{roles};
foreach my $r($role, @{$role->get_roles}){
- if(!$consumer->does_role($r->name)){
+ if(!$consumer->does_role($r)){
push @{$roles}, $r;
}
}
(defined $role_name)
|| $self->throw_error("You must supply a role name to look for");
+ $role_name = $role_name->name if ref $role_name;
+
# if we are it,.. then return true
return 1 if $role_name eq $self->name;
# otherwise.. check our children