Commit | Line | Data |
c001451a |
1 | package MooseX::StrictConstructor::Meta::Class; |
2 | |
3 | use strict; |
4 | use warnings; |
5 | |
c001451a |
6 | use MooseX::StrictConstructor::Meta::Method::Constructor; |
7 | |
58370717 |
8 | use Moose; |
9 | |
10 | extends 'Moose::Meta::Class'; |
c001451a |
11 | |
eb640f6c |
12 | around 'make_immutable' => sub ## no critic RequireArgUnpacking |
58370717 |
13 | { |
eb640f6c |
14 | my $orig = shift; |
c001451a |
15 | my $self = shift; |
16 | |
17 | return |
eb640f6c |
18 | $self->$orig |
c001451a |
19 | ( constructor_class => 'MooseX::StrictConstructor::Meta::Method::Constructor', |
58370717 |
20 | @_, |
c001451a |
21 | ); |
58370717 |
22 | }; |
23 | |
24 | no Moose; |
c001451a |
25 | |
26 | |
27 | 1; |
58370717 |
28 | |
29 | __END__ |
30 | |
31 | =pod |
32 | |
33 | =head1 NAME |
34 | |
35 | MooseX::StrictConstructor::Meta::Class - A meta class for classes with strict constructors |
36 | |
37 | =head1 SYNOPSIS |
38 | |
39 | use MooseX::StrictConstructor; |
40 | |
41 | =head1 DESCRIPTION |
42 | |
43 | This class simply overrides C<make_immutable()> in |
44 | C<Moose::Meta::Class> to use |
45 | C<MooseX::StrictConstructor::Meta::Method::Constructor> as the |
46 | constructor class. |
47 | |
48 | You should never have to use this class directly. |
49 | |
50 | =head1 AUTHOR |
51 | |
52 | Dave Rolsky, C<< <autarch@urth.org> >> |
53 | |
54 | =head1 COPYRIGHT & LICENSE |
55 | |
56 | Copyright 2007 Dave Rolsky, All Rights Reserved. |
57 | |
58 | This program is free software; you can redistribute it and/or modify |
59 | it under the same terms as Perl itself. |
60 | |
61 | =cut |