summaryrefslogtreecommitdiffstats
path: root/lib/MooseX/NonMoose/Meta/Role/Class.pm
blob: 8195b4a379f75d2e1b7f524de71214aceb13818b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package MooseX::NonMoose::Meta::Role::Class;
use Moose::Role;

has replace_constructor => (
    is      => 'rw',
    isa     => 'Bool',
    default => 0,
);

around _make_immutable_transformer => sub {
    my $orig = shift;
    my $self = shift;
    my @args = @_;
    unshift @args, replace_constructor => 1 if $self->replace_constructor;
    $self->$orig(@args);
};

no Moose::Role;

1;