2 package Moose::Policy::SingleInheritence;
4 use constant metaclass => 'Moose::Policy::SingleInheritence::MetaClass';
6 package Moose::Policy::SingleInheritence::MetaClass;
9 extends 'Moose::Meta::Class';
11 before 'superclasses' => sub {
12 my ($self, @superclasses) = @_;
13 confess 'Moose::Policy::SingleInheritence in effect for ' .
14 $self->name . ', only single inheritence is allowed'
15 if scalar @superclasses > 1;
26 Moose::Policy::SingleInheritence - Why would you ever need more than one?
32 use Moose::Policy 'Moose::Policy::SingleInheritence';
37 use Moose::Policy 'Moose::Policy::SingleInheritence';
42 use Moose::Policy 'Moose::Policy::SingleInheritence';
45 extends 'Foo', 'Bar'; # BOOM!!!!
47 =head1 DEPRECATION NOTICE
49 B<Moose::Policy is deprecated>.
53 This module restricts Moose's C<extends> keyword so that you can only assign
56 This is mostly an example of how you can restrict behavior with meta-policies
57 in addition to extending and/or customising them. However, sometimes enforcing
58 a policy like this can be a good thing.
62 All complex software has bugs lurking in it, and this module is no
63 exception. If you find a bug please either email me, or add the bug
68 Stevan Little E<lt>stevan@iinteractive.comE<gt>
70 =head1 COPYRIGHT AND LICENSE
72 Copyright 2006-2007 by Infinity Interactive, Inc.
74 L<http://www.iinteractive.com>
76 This library is free software; you can redistribute it and/or modify
77 it under the same terms as Perl itself.