Make your object constructors blow up on unknown attributes
Clone or download
Latest commit d9f8197 Jan 3, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib fixed header in POD Jan 3, 2019
t silenced test Dec 24, 2018
.gitignore initial commit Dec 5, 2018
.travis.yml initial commit Dec 5, 2018
Changes 0.0.3 Dec 25, 2018
LICENSE initial commit Dec 5, 2018
META6.json 0.0.3 Dec 25, 2018
README.md initial commit Dec 5, 2018
dist.ini initial commit Dec 5, 2018

README.md

Build Status

NAME

StrictClass - Make your object constructors blow up on unknown attributes

SYNOPSIS

use StrictClass;

class MyClass does StrictClass {
    has $.foo;
    has $.bar;
}

MyClass.new( :foo(1), :bar(2), :baz('makes you explode'));

DESCRIPTION

Simply using this role for your class makes your new "strict". This is a great way to catch small typos.

AUTHOR

Martin Barth martin@senfdax.de

head

THANKS TO

* FCO aka SmokeMaschine from #perl6 IRC channel for this code.
* Dave Rolsky for his perl5 module `MooseX::StrictContructor`.

COPYRIGHT AND LICENSE

Copyright 2018 Martin Barth

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.