| Moose documentation | Contained in the Moose distribution. |
Moose::Meta::Role::Method::Required - A Moose metaclass for required methods in Roles
version 2.0010
Moose::Meta::Role::Method::Required is a subclass of Class::MOP::Object.
It is not a subclass of Moose::Meta::Role::Method since it does not
provide an implementation of the method.
This creates a new type constraint based on the provided %options:
The method name. This is required.
Returns the required method's name, as provided to the constructor.
See BUGS in Moose for details on reporting bugs.
Stevan Little <stevan@iinteractive.com>
This software is copyright (c) 2011 by Infinity Interactive, Inc..
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
| Moose documentation | Contained in the Moose distribution. |
package Moose::Meta::Role::Method::Required; BEGIN { $Moose::Meta::Role::Method::Required::AUTHORITY = 'cpan:STEVAN'; } BEGIN { $Moose::Meta::Role::Method::Required::VERSION = '2.0010'; } use strict; use warnings; use metaclass; use overload '""' => sub { shift->name }, # stringify to method name fallback => 1; use base qw(Class::MOP::Object); # This is not a Moose::Meta::Role::Method because it has no implementation, it # is just a name __PACKAGE__->meta->add_attribute('name' => ( reader => 'name', required => 1, )); sub new { shift->_new(@_) } 1; # ABSTRACT: A Moose metaclass for required methods in Roles
__END__