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