Use around for full sugar experience.
[gitmo/MooseX-StrictConstructor.git] / lib / MooseX / StrictConstructor / Meta / Class.pm
1 package MooseX::StrictConstructor::Meta::Class;
2
3 use strict;
4 use warnings;
5
6 use MooseX::StrictConstructor::Meta::Method::Constructor;
7
8 use Moose;
9
10 extends 'Moose::Meta::Class';
11
12 around 'make_immutable' => sub ## no critic RequireArgUnpacking
13 {
14     my $orig = shift;
15     my $self = shift;
16
17     return
18         $self->$orig
19             ( constructor_class => 'MooseX::StrictConstructor::Meta::Method::Constructor',
20               @_,
21             );
22 };
23
24 no Moose;
25
26
27 1;
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