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