Commit | Line | Data |
faa0f968 |
1 | |
2 | package Moose::Meta::Role::Method::Required; |
3 | |
4 | use strict; |
5 | use warnings; |
2cf88ade |
6 | use metaclass; |
7 | |
8 | use overload '""' => sub { shift->name }, # stringify to method name |
9 | fallback => 1; |
10 | |
11 | use base qw(Class::MOP::Object); |
faa0f968 |
12 | |
dbe21639 |
13 | our $VERSION = '0.79'; |
75b95414 |
14 | $VERSION = eval $VERSION; |
faa0f968 |
15 | our $AUTHORITY = 'cpan:STEVAN'; |
16 | |
2cf88ade |
17 | # This is not a Moose::Meta::Role::Method because it has no implementation, it |
18 | # is just a name |
19 | |
20 | __PACKAGE__->meta->add_attribute('name' => (reader => 'name')); |
d67145ed |
21 | |
bc336e8e |
22 | sub new { shift->_new(@_) } |
23 | |
faa0f968 |
24 | 1; |
25 | |
26 | __END__ |
27 | |
28 | =pod |
29 | |
30 | =head1 NAME |
31 | |
32 | Moose::Meta::Role::Method::Required - A Moose metaclass for required methods in Roles |
33 | |
34 | =head1 DESCRIPTION |
35 | |
d7a5a659 |
36 | =head1 INHERITANCE |
37 | |
38 | C<Moose::Meta::Role::Method::Required> is a subclass of L<Class::MOP::Object>. |
39 | It is B<not> a subclass of C<Moose::Meta::Role::Method> since it does not |
40 | provide an implementation of the method. |
41 | |
42 | =head1 METHODS |
43 | |
44 | =over 4 |
45 | |
46 | =item B<< Moose::Meta::Role::Method::Required->new(%options) >> |
47 | |
48 | This creates a new type constraint based on the provided C<%options>: |
49 | |
50 | =over 8 |
51 | |
52 | =item * name |
53 | |
54 | The method name. This is required. |
55 | |
56 | =back |
57 | |
58 | =item B<< $method->name >> |
59 | |
60 | Returns the required method's name, as provided to the constructor. |
61 | |
62 | =back |
63 | |
faa0f968 |
64 | =head1 BUGS |
65 | |
d03bd989 |
66 | All complex software has bugs lurking in it, and this module is no |
faa0f968 |
67 | exception. If you find a bug please either email me, or add the bug |
68 | to cpan-RT. |
69 | |
70 | =head1 AUTHOR |
71 | |
72 | Stevan Little E<lt>stevan@iinteractive.comE<gt> |
73 | |
74 | =head1 COPYRIGHT AND LICENSE |
75 | |
2840a3b2 |
76 | Copyright 2006-2009 by Infinity Interactive, Inc. |
faa0f968 |
77 | |
78 | L<http://www.iinteractive.com> |
79 | |
80 | This library is free software; you can redistribute it and/or modify |
81 | it under the same terms as Perl itself. |
82 | |
07b0f1a5 |
83 | =cut |