1 package MooseX::StrictConstructor::Role::Constructor;
10 around '_generate_BUILDALL' => sub
15 my $source = $self->$orig();
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";
48 MooseX::StrictConstructor::Meta::Method::Constructor - A meta class to make immutable constructors strict
52 use MooseX::StrictConstructor;
56 This class simply overrides C<_generate_BUILDALL()> in
57 C<Moose::Meta::Method::Constructor> so that classes that are made
58 immutable have a strict constructor.
60 You should never have to use this class directly.
64 Dave Rolsky, C<< <autarch@urth.org> >>
66 =head1 COPYRIGHT & LICENSE
68 Copyright 2007 Dave Rolsky, All Rights Reserved.
70 This program is free software; you can redistribute it and/or modify
71 it under the same terms as Perl itself.