1 package MooseX::StrictConstructor::Role::Meta::Method::Constructor;
11 around '_generate_BUILDALL' => sub {
15 my $source = $self->$orig();
16 $source .= ";\n" if $source;
20 map { B::perlstring($_) . ' => 1,' }
22 map { $_->init_arg() } @{ $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";
42 # ABSTRACT: A role to make immutable constructors strict
50 Moose::Util::MetaRole::apply_metaclass_roles
51 ( for_class => $caller,
52 constructor_class_roles =>
53 ['MooseX::StrictConstructor::Role::Meta::Method::Constructor'],
58 This role simply wraps C<_generate_BUILDALL()> (from
59 C<Moose::Meta::Method::Constructor>) so that immutable classes have a