1 package MooseX::StrictConstructor::Role::Meta::Method::Constructor;
10 around '_generate_BUILDALL' => sub {
14 my $source = $self->$orig();
15 $source .= ";\n" if $source;
20 map { $_->init_arg() } @{ $self->_attributes() }
24 my \%attrs = (@attrs);
26 my \@bad = sort grep { ! \$attrs{\$_} } keys \%{ \$params };
29 Carp::confess "Found unknown attribute(s) passed to the constructor: \@bad";
40 # ABSTRACT: A role to make immutable constructors strict
48 Moose::Util::MetaRole::apply_metaclass_roles
49 ( for_class => $caller,
50 constructor_class_roles =>
51 ['MooseX::StrictConstructor::Role::Meta::Method::Constructor'],
56 This role simply wraps C<_generate_BUILDALL()> (from
57 C<Moose::Meta::Method::Constructor>) so that immutable classes have a