MooseX::ABC - abstract base classes for Moose
version 0.02
package Shape; use Moose; use MooseX::ABC; requires 'draw'; package Circle; use Moose; extends 'Shape'; sub draw { # stuff } my $shape = Shape->new; # dies my $circle = Circle->new; # succeeds package Square; use Moose; extends 'Shape'; # dies, since draw is unimplemented
This module adds basic abstract base class functionality to Moose. Doing use MooseX::ABC turns the using class into an abstract class - it cannot be instantiated. It also allows you to mark certain methods in the class as "required", meaning that if a class inherits from this class without implementing that method, it will die at compile time.
use MooseX::ABC
Takes a list of methods that classes inheriting from this one must implement. If a class inherits from this class without implementing each method listed here, an error will be thrown when compiling the class.
Probably want a way to extend abstract classes without dying, making the inheriting class abstract.
No known bugs.
Please report any bugs through RT: email bug-moosex-abc at rt.cpan.org, or browse to http://rt.cpan.org/NoAuth/ReportBug.html?Queue=MooseX-ABC.
bug-moosex-abc at rt.cpan.org
Moose, Moose::Role
You can find this documentation for this module with the perldoc command.
perldoc MooseX::ABC
You can also look for information at:
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/MooseX-ABC
CPAN Ratings
http://cpanratings.perl.org/d/MooseX-ABC
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=MooseX-ABC
Search CPAN
http://search.cpan.org/dist/MooseX-ABC
Jesse Luehrs <doy at tozt dot net>
This software is copyright (c) 2009 by Jesse Luehrs.
This is free software; you can redistribute it and/or modify it under the same terms as perl itself.
To install MooseX::ABC, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MooseX::ABC
CPAN shell
perl -MCPAN -e shell install MooseX::ABC
For more information on module installation, please visit the detailed CPAN module installation guide.