1 package MooseX::StrictConstructor::Role::Metaclass;
6 use MooseX::StrictConstructor::Meta::Method::Constructor;
10 has 'constructor_class' =>
16 sub _build_constructor_class
19 Moose::Meta::Class->create_anon_class
20 ( superclasses => [ 'Moose::Meta::Method::Constructor' ],
21 roles => [ 'MooseX::StrictConstructor::Role::Constructor' ],
26 # If Moose::Meta::Class had a constructor_class attribute, this
27 # wrapper would not be necessary.
28 around 'make_immutable' => sub
35 ( constructor_class => $self->constructor_class(),
51 MooseX::StrictConstructor::Meta::Class - A meta class for classes with strict constructors
55 use MooseX::StrictConstructor;
59 This class simply overrides C<make_immutable()> in
60 C<Moose::Meta::Class> to use
61 C<MooseX::StrictConstructor::Meta::Method::Constructor> as the
64 You should never have to use this class directly.
68 Dave Rolsky, C<< <autarch@urth.org> >>
70 =head1 COPYRIGHT & LICENSE
72 Copyright 2007 Dave Rolsky, All Rights Reserved.
74 This program is free software; you can redistribute it and/or modify
75 it under the same terms as Perl itself.