1 package MooseX::StrictConstructor::Role::Meta::Method::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::Role::Meta::Method::Constructor - A role to make immutable constructors strict
52 use MooseX::StrictConstructor;
56 This role simply wraps C<_generate_BUILDALL()> (from
57 C<Moose::Meta::Method::Constructor>) so that immutable classes have a
62 Dave Rolsky, C<< <autarch@urth.org> >>
64 =head1 COPYRIGHT & LICENSE
66 Copyright 2007-2008 Dave Rolsky, All Rights Reserved.
68 This program is free software; you can redistribute it and/or modify
69 it under the same terms as Perl itself.