1 package MooseX::StrictConstructor::Trait::Method::Constructor;
5 use namespace::autoclean;
10 around '_generate_BUILDALL' => sub {
14 my $source = $self->$orig();
15 $source .= ";\n" if $source;
19 map { B::perlstring($_) . ' => 1,' }
21 map { $_->init_arg() } @{ $self->_attributes() }
25 my \%attrs = (@attrs);
27 my \@bad = sort grep { ! \$attrs{\$_} } keys \%{ \$params };
30 Carp::confess "Found unknown attribute(s) passed to the constructor: \@bad";
39 # ABSTRACT: A role to make immutable constructors strict
47 This role simply wraps C<_generate_BUILDALL()> (from
48 C<Moose::Meta::Method::Constructor>) so that immutable classes have a