1 package MooseX::Object::StrictConstructor;
10 extends 'Moose::Object';
12 after 'BUILDALL' => sub
17 my %attrs = map { $_->name() => 1 } $self->meta()->compute_all_applicable_attributes();
19 my @bad = sort grep { ! $attrs{$_} } keys %{ $params };
23 confess "Found unknown attribute(s) passed to the constructor: @bad";
38 MooseX::Object::StrictConstructor - Implements strict constructors as a Moose::Object subclass
42 This class has no external interface. When you use
43 C<MooseX::StrictConstructor>, your objects will subclass this class
44 rather than Moose::Object.
48 Dave Rolsky, C<< <autarch@urth.org> >>
50 =head1 COPYRIGHT & LICENSE
52 Copyright 2007 Dave Rolsky, All Rights Reserved.
54 This program is free software; you can redistribute it and/or modify
55 it under the same terms as Perl itself.