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