{
    "content": [
        {
            "type": "text",
            "text": "# MooseX::StrictConstructor (perldoc)\n\n## NAME\n\nMooseX::StrictConstructor - Make your object constructors blow up on unknown attributes\n\n## SYNOPSIS\n\npackage My::Class;\nuse Moose;\nuse MooseX::StrictConstructor;\nhas 'size' => ( is => 'ro' );\n# then later ...\n# this blows up because color is not a known attribute\nMy::Class->new( size => 5, color => 'blue' );\n\n## DESCRIPTION\n\nSimply loading this module makes your constructors \"strict\". If your constructor is called with\nan attribute init argument that your class does not declare, then it calls\n\"Moose->throwerror()\". This is a great way to catch small typos.\n\n## Sections\n\n- **NAME**\n- **VERSION**\n- **SYNOPSIS**\n- **DESCRIPTION** (1 subsections)\n- **BUGS**\n- **SOURCE**\n- **DONATIONS**\n- **AUTHOR**\n- **CONTRIBUTORS**\n- **COPYRIGHT AND LICENSE**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "MooseX::StrictConstructor",
        "section": "",
        "mode": "perldoc",
        "summary": "MooseX::StrictConstructor - Make your object constructors blow up on unknown attributes",
        "synopsis": "package My::Class;\nuse Moose;\nuse MooseX::StrictConstructor;\nhas 'size' => ( is => 'ro' );\n# then later ...\n# this blows up because color is not a known attribute\nMy::Class->new( size => 5, color => 'blue' );",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "VERSION",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 12,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 4,
                "subsections": [
                    {
                        "name": "Subverting Strictness",
                        "lines": 17
                    }
                ]
            },
            {
                "name": "BUGS",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "SOURCE",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "DONATIONS",
                "lines": 15,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "CONTRIBUTORS",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "COPYRIGHT AND LICENSE",
                "lines": 8,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "MooseX::StrictConstructor - Make your object constructors blow up on unknown attributes\n",
                "subsections": []
            },
            "VERSION": {
                "content": "version 0.21\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "package My::Class;\n\nuse Moose;\nuse MooseX::StrictConstructor;\n\nhas 'size' => ( is => 'ro' );\n\n# then later ...\n\n# this blows up because color is not a known attribute\nMy::Class->new( size => 5, color => 'blue' );\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "Simply loading this module makes your constructors \"strict\". If your constructor is called with\nan attribute init argument that your class does not declare, then it calls\n\"Moose->throwerror()\". This is a great way to catch small typos.\n",
                "subsections": [
                    {
                        "name": "Subverting Strictness",
                        "content": "You may find yourself wanting to have your constructor accept a parameter which does not\ncorrespond to an attribute.\n\nIn that case, you'll probably also be writing a \"BUILD()\" or \"BUILDARGS()\" method to deal with\nthat parameter. In a \"BUILDARGS()\" method, you can simply make sure that this parameter is not\nincluded in the hash reference you return. Otherwise, in a \"BUILD()\" method, you can delete it\nfrom the hash reference of parameters.\n\nsub BUILD {\nmy $self   = shift;\nmy $params = shift;\n\nif ( delete $params->{dosomething} ) {\n...\n}\n}\n"
                    }
                ]
            },
            "BUGS": {
                "content": "Please report any bugs or feature requests to \"bug-moosex-strictconstructor@rt.cpan.org\", or\nthrough the web interface at <http://rt.cpan.org>. I will be notified, and then you'll\nautomatically be notified of progress on your bug as I make changes.\n\nBugs may be submitted at <https://github.com/moose/MooseX-StrictConstructor/issues>.\n\nI am also usually active on IRC as 'autarch' on \"irc://irc.perl.org\".\n",
                "subsections": []
            },
            "SOURCE": {
                "content": "The source code repository for MooseX-StrictConstructor can be found at\n<https://github.com/moose/MooseX-StrictConstructor>.\n",
                "subsections": []
            },
            "DONATIONS": {
                "content": "If you'd like to thank me for the work I've done on this module, please consider making a\n\"donation\" to me via PayPal. I spend a lot of free time creating free software, and would\nappreciate any support you'd care to offer.\n\nPlease note that I am not suggesting that you must do this in order for me to continue working\non this particular software. I will continue to do so, inasmuch as I have in the past, for as\nlong as it interests me.\n\nSimilarly, a donation made in this way will probably not make me work on this software much\nmore, unless I get so many donations that I can consider working on free software full time\n(let's all have a chuckle at that together).\n\nTo donate, log into PayPal and send money to autarch@urth.org, or use the button at\n<http://www.urth.org/~autarch/fs-donation.html>.\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Dave Rolsky <autarch@urth.org>\n",
                "subsections": []
            },
            "CONTRIBUTORS": {
                "content": "*   Jesse Luehrs <doy@tozt.net>\n\n*   Karen Etheridge <ether@cpan.org>\n\n*   Ricardo Signes <rjbs@cpan.org>\n",
                "subsections": []
            },
            "COPYRIGHT AND LICENSE": {
                "content": "This software is Copyright (c) 2007 - 2017 by Dave Rolsky.\n\nThis is free software, licensed under:\n\nThe Artistic License 2.0 (GPL Compatible)\n\nThe full text of the license can be found in the LICENSE file included with this distribution.\n",
                "subsections": []
            }
        }
    }
}