File: Class.pm

package info (click to toggle)
libmoosex-strictconstructor-perl 0.06-1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 88 kB
  • ctags: 10
  • sloc: perl: 89; makefile: 38
file content (61 lines) | stat: -rw-r--r-- 1,118 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package MooseX::StrictConstructor::Meta::Class;

use strict;
use warnings;

use MooseX::StrictConstructor::Meta::Method::Constructor;

use Moose;

extends 'Moose::Meta::Class';

around 'make_immutable' => sub ## no critic RequireArgUnpacking
{
    my $orig = shift;
    my $self = shift;

    return
        $self->$orig
            ( constructor_class => 'MooseX::StrictConstructor::Meta::Method::Constructor',
              @_,
            );
};

no Moose;


1;

__END__

=pod

=head1 NAME

MooseX::StrictConstructor::Meta::Class - A meta class for classes with strict constructors

=head1 SYNOPSIS

  use MooseX::StrictConstructor;

=head1 DESCRIPTION

This class simply overrides C<make_immutable()> in
C<Moose::Meta::Class> to use
C<MooseX::StrictConstructor::Meta::Method::Constructor> as the
constructor class.

You should never have to use this class directly.

=head1 AUTHOR

Dave Rolsky, C<< <autarch@urth.org> >>

=head1 COPYRIGHT & LICENSE

Copyright 2007 Dave Rolsky, All Rights Reserved.

This program is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.

=cut