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