make github the primary repository
[gitmo/Moose.git] / lib / Moose / Meta / Role / Method / Conflicting.pm
CommitLineData
eec8ca8a 1
bb153262 2package Moose::Meta::Role::Method::Conflicting;
eec8ca8a 3
4use strict;
5use warnings;
6
e893345e 7use Moose::Util;
8
eec8ca8a 9use base qw(Moose::Meta::Role::Method::Required);
10
44ed8891 11__PACKAGE__->meta->add_attribute('roles' => (
12 reader => 'roles',
13 required => 1,
dc2b7cc8 14 Class::MOP::_definition_context(),
44ed8891 15));
eec8ca8a 16
e893345e 17sub roles_as_english_list {
18 my $self = shift;
19 Moose::Util::english_list( map { q{'} . $_ . q{'} } @{ $self->roles } );
20}
21
eec8ca8a 221;
23
ad46f524 24# ABSTRACT: A Moose metaclass for conflicting methods in Roles
25
eec8ca8a 26__END__
27
28=pod
29
eec8ca8a 30=head1 DESCRIPTION
31
32=head1 INHERITANCE
33
bb153262 34C<Moose::Meta::Role::Method::Conflicting> is a subclass of
eec8ca8a 35L<Moose::Meta::Role::Method::Required>.
36
97403951 37=head1 METHODS
38
39=over 4
40
49f8f3e6 41=item B<< Moose::Meta::Role::Method::Conflicting->new(%options) >>
42
43This creates a new type constraint based on the provided C<%options>:
44
45=over 8
46
47=item * name
48
49The method name. This is required.
50
51=item * roles
52
53The list of role names that generated the conflict. This is required.
54
55=back
56
57=item B<< $method->name >>
58
59Returns the conflicting method's name, as provided to the constructor.
60
61=item B<< $method->roles >>
62
63Returns the roles that generated this conflicting method, as provided to the
64constructor.
65
e893345e 66=item B<< $method->roles_as_english_list >>
67
68Returns the roles that generated this conflicting method as an English list.
69
97403951 70=back
71
eec8ca8a 72=head1 BUGS
73
d4048ef3 74See L<Moose/BUGS> for details on reporting bugs.
eec8ca8a 75
eec8ca8a 76=cut