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