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 | |
44ed8891 |
11 | __PACKAGE__->meta->add_attribute('roles' => ( |
12 | reader => 'roles', |
13 | required => 1, |
dc2b7cc8 |
14 | Class::MOP::_definition_context(), |
44ed8891 |
15 | )); |
eec8ca8a |
16 | |
e893345e |
17 | sub roles_as_english_list { |
18 | my $self = shift; |
19 | Moose::Util::english_list( map { q{'} . $_ . q{'} } @{ $self->roles } ); |
20 | } |
21 | |
eec8ca8a |
22 | 1; |
23 | |
ad46f524 |
24 | # ABSTRACT: A Moose metaclass for conflicting methods in Roles |
25 | |
eec8ca8a |
26 | __END__ |
27 | |
28 | =pod |
29 | |
eec8ca8a |
30 | =head1 DESCRIPTION |
31 | |
32 | =head1 INHERITANCE |
33 | |
bb153262 |
34 | C<Moose::Meta::Role::Method::Conflicting> is a subclass of |
eec8ca8a |
35 | L<Moose::Meta::Role::Method::Required>. |
36 | |
97403951 |
37 | =head1 METHODS |
38 | |
39 | =over 4 |
40 | |
49f8f3e6 |
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 | |
e893345e |
66 | =item B<< $method->roles_as_english_list >> |
67 | |
68 | Returns the roles that generated this conflicting method as an English list. |
69 | |
97403951 |
70 | =back |
71 | |
eec8ca8a |
72 | =head1 BUGS |
73 | |
d4048ef3 |
74 | See L<Moose/BUGS> for details on reporting bugs. |
eec8ca8a |
75 | |
eec8ca8a |
76 | =cut |