1 package MooseX::Object::StrictConstructor;
10 use metaclass 'MooseX::StrictConstructor::Meta::Class';
13 extends 'Moose::Object';
15 after 'BUILDALL' => sub
20 my %attrs = map { $_->name() => 1 } $self->meta()->compute_all_applicable_attributes();
22 my @bad = sort grep { ! $attrs{$_} } keys %{ $params };
26 confess "Found unknown attribute(s) passed to the constructor: @bad";
41 MooseX::Object::StrictConstructor - Implements strict constructors as a Moose::Object subclass
45 This class has no external interface. When you use
46 C<MooseX::StrictConstructor>, your objects will subclass this class
47 rather than Moose::Object.
51 Dave Rolsky, C<< <autarch@urth.org> >>
53 =head1 COPYRIGHT & LICENSE
55 Copyright 2007 Dave Rolsky, All Rights Reserved.
57 This program is free software; you can redistribute it and/or modify
58 it under the same terms as Perl itself.