| MooseX-ABC documentation | Contained in the MooseX-ABC distribution. |
MooseX::ABC::Role::Object - base object role for MooseX::ABC
version 0.05
This is a base object role implementing the behavior of MooseX::ABC classes being uninstantiable.
Jesse Luehrs <doy at tozt dot net>
This software is copyright (c) 2010 by Jesse Luehrs.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
| MooseX-ABC documentation | Contained in the MooseX-ABC distribution. |
package MooseX::ABC::Role::Object; BEGIN { $MooseX::ABC::Role::Object::VERSION = '0.05'; } use Moose::Role; # ABSTRACT: base object role for L<MooseX::ABC> 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; 1; __END__