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