{
    "content": [
        {
            "type": "text",
            "text": "# Moose::Util::MetaRole (info)\n\n## NAME\n\nMoose::Util::MetaRole - Apply roles to any metaclass, as well as the object base class\n\n## SYNOPSIS\n\npackage MyApp::Moose;\nuse Moose ();\nuse Moose::Exporter;\nuse Moose::Util::MetaRole;\nuse MyApp::Role::Meta::Class;\nuse MyApp::Role::Meta::Method::Constructor;\nuse MyApp::Role::Object;\nMoose::Exporter->setupimportmethods( also => 'Moose' );\nsub initmeta {\nshift;\nmy %args = @;\nMoose->initmeta(%args);\nMoose::Util::MetaRole::applymetaroles(\nfor             => $args{forclass},\nclassmetaroles => {\nclass       => ['MyApp::Role::Meta::Class'],\nconstructor => ['MyApp::Role::Meta::Method::Constructor'],\n},\n);\nMoose::Util::MetaRole::applybaseclassroles(\nfor   => $args{forclass},\nroles => ['MyApp::Role::Object'],\n);\nreturn $args{forclass}->meta();\n}\n\n## DESCRIPTION\n\nThis utility module is designed to help authors of Moose extensions\nwrite extensions that are able to cooperate with other Moose\nextensions. To do this, you must write your extensions as roles, which\ncan then be dynamically applied to the caller's metaclasses.\n\n## Sections\n\n- **Moose::Util::MetaRole(User Contributed Perl DocumentMoose::Util::MetaRole(3pm)**\n- **NAME**\n- **VERSION**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **USAGE**\n- **FUNCTIONS**\n- **BUGS**\n- **AUTHORS**\n- **COPYRIGHT AND LICENSE**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Moose::Util::MetaRole",
        "section": "",
        "mode": "info",
        "summary": "Moose::Util::MetaRole - Apply roles to any metaclass, as well as the object base class",
        "synopsis": "package MyApp::Moose;\nuse Moose ();\nuse Moose::Exporter;\nuse Moose::Util::MetaRole;\nuse MyApp::Role::Meta::Class;\nuse MyApp::Role::Meta::Method::Constructor;\nuse MyApp::Role::Object;\nMoose::Exporter->setupimportmethods( also => 'Moose' );\nsub initmeta {\nshift;\nmy %args = @;\nMoose->initmeta(%args);\nMoose::Util::MetaRole::applymetaroles(\nfor             => $args{forclass},\nclassmetaroles => {\nclass       => ['MyApp::Role::Meta::Class'],\nconstructor => ['MyApp::Role::Meta::Method::Constructor'],\n},\n);\nMoose::Util::MetaRole::applybaseclassroles(\nfor   => $args{forclass},\nroles => ['MyApp::Role::Object'],\n);\nreturn $args{forclass}->meta();\n}",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "Moose::Util::MetaRole(User Contributed Perl DocumentMoose::Util::MetaRole(3pm)",
                "lines": 1,
                "subsections": []
            },
            {
                "name": "NAME",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "VERSION",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 34,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "USAGE",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "FUNCTIONS",
                "lines": 56,
                "subsections": []
            },
            {
                "name": "BUGS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "AUTHORS",
                "lines": 20,
                "subsections": []
            },
            {
                "name": "COPYRIGHT AND LICENSE",
                "lines": 6,
                "subsections": []
            }
        ],
        "sections": {
            "Moose::Util::MetaRole(User Contributed Perl DocumentMoose::Util::MetaRole(3pm)": {
                "content": "",
                "subsections": []
            },
            "NAME": {
                "content": "Moose::Util::MetaRole - Apply roles to any metaclass, as well as the\nobject base class\n",
                "subsections": []
            },
            "VERSION": {
                "content": "version 2.2200\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "package MyApp::Moose;\n\nuse Moose ();\nuse Moose::Exporter;\nuse Moose::Util::MetaRole;\n\nuse MyApp::Role::Meta::Class;\nuse MyApp::Role::Meta::Method::Constructor;\nuse MyApp::Role::Object;\n\nMoose::Exporter->setupimportmethods( also => 'Moose' );\n\nsub initmeta {\nshift;\nmy %args = @;\n\nMoose->initmeta(%args);\n\nMoose::Util::MetaRole::applymetaroles(\nfor             => $args{forclass},\nclassmetaroles => {\nclass       => ['MyApp::Role::Meta::Class'],\nconstructor => ['MyApp::Role::Meta::Method::Constructor'],\n},\n);\n\nMoose::Util::MetaRole::applybaseclassroles(\nfor   => $args{forclass},\nroles => ['MyApp::Role::Object'],\n);\n\nreturn $args{forclass}->meta();\n}\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "This utility module is designed to help authors of Moose extensions\nwrite extensions that are able to cooperate with other Moose\nextensions. To do this, you must write your extensions as roles, which\ncan then be dynamically applied to the caller's metaclasses.\n\nThis module makes sure to preserve any existing superclasses and roles\nalready set for the meta objects, which means that any number of\nextensions can apply roles in any order.\n",
                "subsections": []
            },
            "USAGE": {
                "content": "The easiest way to use this module is through Moose::Exporter, which\ncan generate the appropriate \"initmeta\" method for you, and make sure\nit is called when imported.\n",
                "subsections": []
            },
            "FUNCTIONS": {
                "content": "This module provides two functions.\n\napplymetaroles( ... )\nThis function will apply roles to one or more metaclasses for the\nspecified class. It will return a new metaclass object for the class or\nrole passed in the \"for\" parameter.\n\nIt accepts the following parameters:\n\no   for => $name\n\nThis specifies the class or for which to alter the meta classes.\nThis can be a package name, or an appropriate meta-object (a\nMoose::Meta::Class or Moose::Meta::Role).\n\no   classmetaroles => \\%roles\n\nThis is a hash reference specifying which metaroles will be applied\nto the class metaclass and its contained metaclasses and helper\nclasses.\n\nEach key should in turn point to an array reference of role names.\n\nIt accepts the following keys:\n\nclass\nattribute\nmethod\nwrappedmethod\ninstance\nconstructor\ndestructor\nerror\no   rolemetaroles => \\%roles\n\nThis is a hash reference specifying which metaroles will be applied\nto the role metaclass and its contained metaclasses and helper\nclasses.\n\nIt accepts the following keys:\n\nrole\nattribute\nmethod\nrequiredmethod\nconflictingmethod\napplicationtoclass\napplicationtorole\napplicationtoinstance\napplicationrolesummation\nappliedattribute\n\napplybaseclassroles( for => $class, roles => \\@roles )\nThis function will apply the specified roles to the object's base\nclass.\n",
                "subsections": []
            },
            "BUGS": {
                "content": "See \"BUGS\" in Moose for details on reporting bugs.\n",
                "subsections": []
            },
            "AUTHORS": {
                "content": "o   Stevan Little <stevan@cpan.org>\n\no   Dave Rolsky <autarch@urth.org>\n\no   Jesse Luehrs <doy@cpan.org>\n\no   Shawn M Moore <sartak@cpan.org>\n\no    ' (Yuval Kogman) <nothingmuch@woobling.org>\n\no   Karen Etheridge <ether@cpan.org>\n\no   Florian Ragwitz <rafl@debian.org>\n\no   Hans Dieter Pearcey <hdp@cpan.org>\n\no   Chris Prather <chris@prather.org>\n\no   Matt S Trout <mstrout@cpan.org>\n",
                "subsections": []
            },
            "COPYRIGHT AND LICENSE": {
                "content": "This software is copyright (c) 2006 by Infinity Interactive, Inc.\n\nThis is free software; you can redistribute it and/or modify it under\nthe same terms as the Perl 5 programming language system itself.\n\nperl v5.34.0                      2022-02-06        Moose::Util::MetaRole(3pm)",
                "subsections": []
            }
        }
    }
}