{
    "content": [
        {
            "type": "text",
            "text": "# Moose::Meta::Role (perldoc)\n\n## NAME\n\nMoose::Meta::Role - The Moose Role metaclass\n\n## DESCRIPTION\n\nThis class is a subclass of Class::MOP::Module that provides additional Moose-specific\nfunctionality.\n\n## Sections\n\n- **NAME**\n- **VERSION**\n- **DESCRIPTION**\n- **INHERITANCE**\n- **METHODS** (9 subsections)\n- **BUGS**\n- **AUTHORS**\n- **COPYRIGHT AND LICENSE**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Moose::Meta::Role",
        "section": "",
        "mode": "perldoc",
        "summary": "Moose::Meta::Role - The Moose Role metaclass",
        "synopsis": null,
        "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": "DESCRIPTION",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "INHERITANCE",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "METHODS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "Construction",
                        "lines": 29
                    },
                    {
                        "name": "Role application",
                        "lines": 11
                    },
                    {
                        "name": "Roles and other roles",
                        "lines": 22
                    },
                    {
                        "name": "Methods",
                        "lines": 13
                    },
                    {
                        "name": "Attributes",
                        "lines": 14
                    },
                    {
                        "name": "Overload introspection and creation",
                        "lines": 10
                    },
                    {
                        "name": "Required methods",
                        "lines": 16
                    },
                    {
                        "name": "Method modifiers",
                        "lines": 25
                    },
                    {
                        "name": "Introspection",
                        "lines": 3
                    }
                ]
            },
            {
                "name": "BUGS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "AUTHORS",
                "lines": 20,
                "subsections": []
            },
            {
                "name": "COPYRIGHT AND LICENSE",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Moose::Meta::Role - The Moose Role metaclass\n",
                "subsections": []
            },
            "VERSION": {
                "content": "version 2.2200\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "This class is a subclass of Class::MOP::Module that provides additional Moose-specific\nfunctionality.\n\nIts API looks a lot like Moose::Meta::Class, but internally it implements many things\ndifferently. This may change in the future.\n",
                "subsections": []
            },
            "INHERITANCE": {
                "content": "\"Moose::Meta::Role\" is a subclass of Class::MOP::Module.\n",
                "subsections": []
            },
            "METHODS": {
                "content": "",
                "subsections": [
                    {
                        "name": "Construction",
                        "content": "Moose::Meta::Role->initialize($rolename)\nThis method creates a new role object with the provided name.\n\nMoose::Meta::Role->combine( [ $role => { ... } ], [ $role ], ... )\nThis method accepts a list of array references. Each array reference should contain a role name\nor Moose::Meta::Role object as its first element. The second element is an optional hash\nreference. The hash reference can contain \"-excludes\" and \"-alias\" keys to control how methods\nare composed from the role.\n\nThe return value is a new Moose::Meta::Role::Composite that represents the combined roles.\n\n$metarole->compositionclassroles\nWhen combining multiple roles using \"combine\", this method is used to obtain a list of role\nnames to be applied to the Moose::Meta::Role::Composite instance returned by \"combine\". The\ndefault implementation returns an empty list. Extensions that need to hook into role combination\nmay wrap this method to return additional role names.\n\nMoose::Meta::Role->create($name, %options)\nThis method is identical to the Moose::Meta::Class \"create\" method.\n\nMoose::Meta::Role->createanonrole\nThis method is identical to the Moose::Meta::Class \"createanonclass\" method.\n\n$metarole->isanonrole\nReturns true if the role is an anonymous role.\n\n$metarole->consumers\nReturns a list of names of classes and roles which consume this role.\n"
                    },
                    {
                        "name": "Role application",
                        "content": "$metarole->apply( $thing, @options )\nThis method applies a role to the given $thing. That can be another Moose::Meta::Role, object, a\nMoose::Meta::Class object, or a (non-meta) object instance.\n\nThe options are passed directly to the constructor for the appropriate\nMoose::Meta::Role::Application subclass.\n\nNote that this will apply the role even if the $thing in question already \"does\" this role.\n\"doesrole\" in Moose::Util is a convenient wrapper for finding out if role application is\nnecessary.\n"
                    },
                    {
                        "name": "Roles and other roles",
                        "content": "$metarole->getroles\nThis returns an array reference of roles which this role does. This list may include duplicates.\n\n$metarole->calculateallroles\nThis returns a *unique* list of all roles that this role does, and all the roles that its roles\ndo.\n\n$metarole->doesrole($role)\nGiven a role *name* or Moose::Meta::Role object, returns true if this role does the given role.\n\n$metarole->addrole($role)\nGiven a Moose::Meta::Role object, this adds the role to the list of roles that the role does.\n\n$metarole->getexcludedroleslist\nReturns a list of role names which this role excludes.\n\n$metarole->excludesrole($rolename)\nGiven a role *name*, returns true if this role excludes the named role.\n\n$metarole->addexcludedroles(@rolenames)\nGiven one or more role names, adds those roles to the list of excluded roles.\n"
                    },
                    {
                        "name": "Methods",
                        "content": "The methods for dealing with a role's methods are all identical in API and behavior to the same\nmethods in Class::MOP::Class.\n\n$metarole->methodmetaclass\nReturns the method metaclass name for the role. This defaults to Moose::Meta::Role::Method.\n\n$metarole->getmethod($name)\n$metarole->hasmethod($name)\n$metarole->addmethod( $name, $body )\n$metarole->getmethodlist\n$metarole->findmethodbyname($name)\nThese methods are all identical to the methods of the same name in Class::MOP::Package\n"
                    },
                    {
                        "name": "Attributes",
                        "content": "As with methods, the methods for dealing with a role's attribute are all identical in API and\nbehavior to the same methods in Class::MOP::Class.\n\nHowever, attributes stored in this class are *not* stored as objects. Rather, the attribute\ndefinition is stored as a hash reference. When a role is composed into a class, this hash\nreference is passed directly to the metaclass's \"addattribute\" method.\n\nThis is quite likely to change in the future.\n\n$metarole->getattribute($attributename)\n$metarole->hasattribute($attributename)\n$metarole->getattributelist\n$metarole->addattribute($name, %options)\n$metarole->removeattribute($attributename)"
                    },
                    {
                        "name": "Overload introspection and creation",
                        "content": "The methods for dealing with a role's overloads are all identical in API and behavior to the\nsame methods in Class::MOP::Class.\n\n$metarole->isoverloaded\n$metarole->getoverloadedoperator($op)\n$metarole->hasoverloadedoperator($op)\n$metarole->getoverloadlist\n$metarole->getalloverloadedoperators\n$metarole->addoverloadedoperator($op, $impl)\n$metarole->removeoverloadedoperator($op)"
                    },
                    {
                        "name": "Required methods",
                        "content": "$metarole->getrequiredmethodlist\nReturns the list of methods required by the role.\n\n$metarole->requiresmethod($name)\nReturns true if the role requires the named method.\n\n$metarole->addrequiredmethods(@names)\nAdds the named methods to the role's list of required methods.\n\n$metarole->removerequiredmethods(@names)\nRemoves the named methods from the role's list of required methods.\n\n$metarole->addconflictingmethod(%params)\nInstantiate the parameters as a Moose::Meta::Role::Method::Conflicting object, then add it to\nthe required method list.\n"
                    },
                    {
                        "name": "Method modifiers",
                        "content": "These methods act like their counterparts in Class::MOP::Class and Moose::Meta::Class.\n\nHowever, method modifiers are simply stored internally, and are not applied until the role\nitself is applied to a class or object.\n\n$metarole->addaftermethodmodifier($methodname, $method)\n$metarole->addaroundmethodmodifier($methodname, $method)\n$metarole->addbeforemethodmodifier($methodname, $method)\n$metarole->addoverridemethodmodifier($methodname, $method)\nThese methods all add an appropriate modifier to the internal list of modifiers.\n\n$metarole->hasaftermethodmodifiers\n$metarole->hasaroundmethodmodifiers\n$metarole->hasbeforemethodmodifiers\n$metarole->hasoverridemethodmodifier\nReturn true if the role has any modifiers of the given type.\n\n$metarole->getaftermethodmodifiers($methodname)\n$metarole->getaroundmethodmodifiers($methodname)\n$metarole->getbeforemethodmodifiers($methodname)\nGiven a method name, returns a list of the appropriate modifiers for that method.\n\n$metarole->getoverridemethodmodifier($methodname)\nGiven a method name, returns the override method modifier for that method, if it has one.\n"
                    },
                    {
                        "name": "Introspection",
                        "content": "Moose::Meta::Role->meta\nThis will return a Class::MOP::Class instance for this class.\n"
                    }
                ]
            },
            "BUGS": {
                "content": "See \"BUGS\" in Moose for details on reporting bugs.\n",
                "subsections": []
            },
            "AUTHORS": {
                "content": "*   Stevan Little <stevan@cpan.org>\n\n*   Dave Rolsky <autarch@urth.org>\n\n*   Jesse Luehrs <doy@cpan.org>\n\n*   Shawn M Moore <sartak@cpan.org>\n\n*   יובל קוג'מן (Yuval Kogman) <nothingmuch@woobling.org>\n\n*   Karen Etheridge <ether@cpan.org>\n\n*   Florian Ragwitz <rafl@debian.org>\n\n*   Hans Dieter Pearcey <hdp@cpan.org>\n\n*   Chris Prather <chris@prather.org>\n\n*   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 the same terms as the Perl\n5 programming language system itself.\n",
                "subsections": []
            }
        }
    }
}