ClassX::StrictConstructor

Make your object constructors blow up on unknown attributes

NAME

ClassX::StrictConstructor - Make your object constructors blow up on unknown attributes

SYNOPSIS

use ClassX::StrictConstructor;

class Foo does ClassX::StrictConstructor {
    has $.a;
    has %.b;
}

Foo.new(a => 1, b => {bb => 2, bbb => 3});  # ok

Foo.new(a => 1, b => 2, c => 3);            # dies

DESCRIPTION

This is Perl's MooseX::StrictConstructor module ported to Raku as a role.

The test suite is ported as well, except for the parts that don't make sense in Raku anymore.

I had fun writing this. I hope you enjoy using it too.

AUTHOR

Tadeusz Soƛnierz

COPYRIGHT AND LICENSE

Copyright 2014 - 2019 Tadeusz Soƛnierz

Copyright 2024 Raku Community

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

ClassX::StrictConstructor v0.2

Make your object constructors blow up on unknown attributes

Authors

    License

    MIT

    Dependencies

    Test Dependencies

    Provides

    • ClassX::StrictConstructor

    Documentation

    The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.