no more perl critic
[gitmo/MooseX-StrictConstructor.git] / lib / MooseX / StrictConstructor / Role / Metaclass.pm
CommitLineData
0cdff431 1package MooseX::StrictConstructor::Role::Metaclass;
c001451a 2
3use strict;
4use warnings;
5
c001451a 6use MooseX::StrictConstructor::Meta::Method::Constructor;
7
0cdff431 8use Moose::Role;
58370717 9
c001451a 10
b210d8fb 11around 'make_immutable' => sub
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 23no Moose::Role;
c001451a 24
25
261;
58370717 27
28__END__
29
30=pod
31
32=head1 NAME
33
34MooseX::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
42This class simply overrides C<make_immutable()> in
43C<Moose::Meta::Class> to use
44C<MooseX::StrictConstructor::Meta::Method::Constructor> as the
45constructor class.
46
47You should never have to use this class directly.
48
49=head1 AUTHOR
50
51Dave Rolsky, C<< <autarch@urth.org> >>
52
53=head1 COPYRIGHT & LICENSE
54
55Copyright 2007 Dave Rolsky, All Rights Reserved.
56
57This program is free software; you can redistribute it and/or modify
58it under the same terms as Perl itself.
59
60=cut