1 package MooseX::StrictConstructor::Role::Meta::Method::Constructor;
10 around '_generate_BUILDALL' => sub {
14 my $source = $self->$orig();
15 $source .= ";\n" if $source;
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";
41 # ABSTRACT: A role to make immutable constructors strict
49 Moose::Util::MetaRole::apply_metaclass_roles
50 ( for_class => $caller,
51 constructor_class_roles =>
52 ['MooseX::StrictConstructor::Role::Meta::Method::Constructor'],
57 This role simply wraps C<_generate_BUILDALL()> (from
58 C<Moose::Meta::Method::Constructor>) so that immutable classes have a