Commit | Line | Data |
eec8ca8a |
1 | |
bb153262 |
2 | package Moose::Meta::Role::Method::Conflicting; |
eec8ca8a |
3 | |
4 | use strict; |
5 | use warnings; |
6 | |
e893345e |
7 | use Moose::Util; |
8 | |
eec8ca8a |
9 | use base qw(Moose::Meta::Role::Method::Required); |
10 | |
eec8ca8a |
11 | our $AUTHORITY = 'cpan:STEVAN'; |
12 | |
44ed8891 |
13 | __PACKAGE__->meta->add_attribute('roles' => ( |
14 | reader => 'roles', |
15 | required => 1, |
16 | )); |
eec8ca8a |
17 | |
e893345e |
18 | sub roles_as_english_list { |
19 | my $self = shift; |
20 | Moose::Util::english_list( map { q{'} . $_ . q{'} } @{ $self->roles } ); |
21 | } |
22 | |
eec8ca8a |
23 | 1; |
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 |
35 | C<Moose::Meta::Role::Method::Conflicting> is a subclass of |
eec8ca8a |
36 | L<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 | |
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 | |
e893345e |
67 | =item B<< $method->roles_as_english_list >> |
68 | |
69 | Returns the roles that generated this conflicting method as an English list. |
70 | |
97403951 |
71 | =back |
72 | |
eec8ca8a |
73 | =head1 BUGS |
74 | |
d4048ef3 |
75 | See L<Moose/BUGS> for details on reporting bugs. |
eec8ca8a |
76 | |
eec8ca8a |
77 | =cut |