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