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