1 package MooseX::StrictConstructor::Meta::Method::Constructor;
9 extends 'Moose::Meta::Method::Constructor';
11 override '_generate_BUILDALL' => sub ## no critic RequireArgUnpacking
16 $source .= ";\n" if $source;
21 map { $_->init_arg() }
22 @{ $self->attributes() }
26 my \%attrs = (@attrs);
28 my \@bad = sort grep { ! \$attrs{\$_} } keys \%params;
31 Carp::confess "Found unknown attribute(s) passed to the constructor: \@bad";
49 MooseX::StrictConstructor::Meta::Method::Constructor - A meta class to make immutable constructors strict
53 use MooseX::StrictConstructor;
57 This class simply overrides C<_generate_BUILDALL()> in
58 C<Moose::Meta::Method::Constructor> so that classes that are made
59 immutable have a strict constructor.
61 You should never have to use this class directly.
65 Dave Rolsky, C<< <autarch@urth.org> >>
67 =head1 COPYRIGHT & LICENSE
69 Copyright 2007 Dave Rolsky, All Rights Reserved.
71 This program is free software; you can redistribute it and/or modify
72 it under the same terms as Perl itself.