package MooseX::ABC::Role::Object; use Moose::Role; =head1 NAME MooseX::ABC::Role::Object - base object role for L =head1 DESCRIPTION This is a base object role implementing the behavior of L classes being uninstantiable. =cut around new => sub { my $orig = shift; my $class = shift; my $meta = Class::MOP::class_of($class); $meta->throw_error("$class is abstract, it cannot be instantiated") if $meta->is_abstract; $class->$orig(@_); }; no Moose::Role; =head1 SUPPORT You can find this documentation for this module with the perldoc command. perldoc MooseX::ABC You can also look for information at: =over 4 =item * AnnoCPAN: Annotated CPAN documentation L =item * CPAN Ratings L =item * RT: CPAN's request tracker L =item * Search CPAN L =back =head1 AUTHOR Jesse Luehrs =head1 COPYRIGHT AND LICENSE 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. =cut 1;