{
    "content": [
        {
            "type": "text",
            "text": "# Role::Tiny (perldoc)\n\n## NAME\n\nRole::Tiny - Roles: a nouvelle cuisine portion size slice of Moose\n\n## SYNOPSIS\n\npackage Some::Role;\nuse Role::Tiny;\nsub foo { ... }\nsub bar { ... }\naround baz => sub { ... };\n1;\nelsewhere\npackage Some::Class;\nuse Role::Tiny::With;\n# bar gets imported, but not foo\nwith 'Some::Role';\nsub foo { ... }\n# baz is wrapped in the around modifier by Class::Method::Modifiers\nsub baz { ... }\n1;\nIf you wanted attributes as well, look at Moo::Role.\n\n## DESCRIPTION\n\n\"Role::Tiny\" is a minimalist role composition tool.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **ROLE COMPOSITION**\n- **IMPORTED SUBROUTINES** (1 subsections)\n- **SUBROUTINES**\n- **METHODS**\n- **CAVEATS**\n- **SEE ALSO**\n- **AUTHOR**\n- **CONTRIBUTORS**\n- **COPYRIGHT**\n- **LICENSE**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Role::Tiny",
        "section": "",
        "mode": "perldoc",
        "summary": "Role::Tiny - Roles: a nouvelle cuisine portion size slice of Moose",
        "synopsis": "package Some::Role;\nuse Role::Tiny;\nsub foo { ... }\nsub bar { ... }\naround baz => sub { ... };\n1;\nelsewhere\npackage Some::Class;\nuse Role::Tiny::With;\n# bar gets imported, but not foo\nwith 'Some::Role';\nsub foo { ... }\n# baz is wrapped in the around modifier by Class::Method::Modifiers\nsub baz { ... }\n1;\nIf you wanted attributes as well, look at Moo::Role.",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 30,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "ROLE COMPOSITION",
                "lines": 29,
                "subsections": []
            },
            {
                "name": "IMPORTED SUBROUTINES",
                "lines": 47,
                "subsections": [
                    {
                        "name": "Strict and Warnings",
                        "lines": 3
                    }
                ]
            },
            {
                "name": "SUBROUTINES",
                "lines": 20,
                "subsections": []
            },
            {
                "name": "METHODS",
                "lines": 29,
                "subsections": []
            },
            {
                "name": "CAVEATS",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "CONTRIBUTORS",
                "lines": 26,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "LICENSE",
                "lines": 2,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Role::Tiny - Roles: a nouvelle cuisine portion size slice of Moose\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "package Some::Role;\n\nuse Role::Tiny;\n\nsub foo { ... }\n\nsub bar { ... }\n\naround baz => sub { ... };\n\n1;\n\nelsewhere\n\npackage Some::Class;\n\nuse Role::Tiny::With;\n\n# bar gets imported, but not foo\nwith 'Some::Role';\n\nsub foo { ... }\n\n# baz is wrapped in the around modifier by Class::Method::Modifiers\nsub baz { ... }\n\n1;\n\nIf you wanted attributes as well, look at Moo::Role.\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "\"Role::Tiny\" is a minimalist role composition tool.\n",
                "subsections": []
            },
            "ROLE COMPOSITION": {
                "content": "Role composition can be thought of as much more clever and meaningful multiple inheritance. The\nbasics of this implementation of roles is:\n\n* If a method is already defined on a class, that method will not be composed in from the role.\nA method inherited by a class gets overridden by the role's method of the same name, though.\n\n* If a method that the role \"requires\" to be implemented is not implemented, role application\nwill fail loudly.\n\nUnlike Class::C3, where the last class inherited from \"wins,\" role composition is the other way\naround, where the class wins. If multiple roles are applied in a single call (single with\nstatement), then if any of their provided methods clash, an exception is raised unless the class\nprovides a method since this conflict indicates a potential problem.\n\nROLE METHODS\nAll subs created after importing Role::Tiny will be considered methods to be composed. For\nexample:\n\npackage MyRole;\nuse List::Util qw(min);\nsub mysub { }\nuse Role::Tiny;\nuse List::Util qw(max);\nsub mymethod { }\n\nIn this role, \"max\" and \"mymethod\" will be included when composing MyRole, and \"min\" and \"mysub\"\nwill not. For additional control, namespace::clean can be used to exclude undesired subs from\nroles.\n",
                "subsections": []
            },
            "IMPORTED SUBROUTINES": {
                "content": "requires\nrequires qw(foo bar);\n\nDeclares a list of methods that must be defined to compose role.\n\nwith\nwith 'Some::Role1';\n\nwith 'Some::Role1', 'Some::Role2';\n\nComposes another role into the current role (or class via Role::Tiny::With).\n\nIf you have conflicts and want to resolve them in favour of Some::Role1 you can instead write:\n\nwith 'Some::Role1';\nwith 'Some::Role2';\n\nIf you have conflicts and want to resolve different conflicts in favour of different roles,\nplease refactor your codebase.\n\nbefore\nbefore foo => sub { ... };\n\nSee \"before method(s) => sub { ... };\" in Class::Method::Modifiers for full documentation.\n\nNote that since you are not required to use method modifiers, Class::Method::Modifiers is lazily\nloaded and we do not declare it as a dependency. If your Role::Tiny role uses modifiers you must\ndepend on both Class::Method::Modifiers and Role::Tiny.\n\naround\naround foo => sub { ... };\n\nSee \"around method(s) => sub { ... };\" in Class::Method::Modifiers for full documentation.\n\nNote that since you are not required to use method modifiers, Class::Method::Modifiers is lazily\nloaded and we do not declare it as a dependency. If your Role::Tiny role uses modifiers you must\ndepend on both Class::Method::Modifiers and Role::Tiny.\n\nafter\nafter foo => sub { ... };\n\nSee \"after method(s) => sub { ... };\" in Class::Method::Modifiers for full documentation.\n\nNote that since you are not required to use method modifiers, Class::Method::Modifiers is lazily\nloaded and we do not declare it as a dependency. If your Role::Tiny role uses modifiers you must\ndepend on both Class::Method::Modifiers and Role::Tiny.\n",
                "subsections": [
                    {
                        "name": "Strict and Warnings",
                        "content": "In addition to importing subroutines, using \"Role::Tiny\" applies strict and warnings to the\ncaller.\n"
                    }
                ]
            },
            "SUBROUTINES": {
                "content": "doesrole\nif (Role::Tiny::doesrole($foo, 'Some::Role')) {\n...\n}\n\nReturns true if class has been composed with role.\n\nThis subroutine is also installed as ->does on any class a Role::Tiny is composed into unless\nthat class already has an ->does method, so\n\nif ($foo->does('Some::Role')) {\n...\n}\n\nwill work for classes but to test a role, one must use ::doesrole directly.\n\nAdditionally, Role::Tiny will override the standard Perl \"DOES\" method for your class. However,\nif \"any\" class in your class' inheritance hierarchy provides \"DOES\", then Role::Tiny will not\noverride it.\n",
                "subsections": []
            },
            "METHODS": {
                "content": "makerole\nRole::Tiny->makerole('Some::Role');\n\nMakes a package into a role, but does not export any subs into it.\n\napplyrolestopackage\nRole::Tiny->applyrolestopackage(\n'Some::Package', 'Some::Role', 'Some::Other::Role'\n);\n\nComposes role with package. See also Role::Tiny::With.\n\napplyrolestoobject\nRole::Tiny->applyrolestoobject($foo, qw(Some::Role1 Some::Role2));\n\nComposes roles in order into object directly. Object is reblessed into the resulting class. Note\nthat the object's methods get overridden by the role's ones with the same names.\n\ncreateclasswithroles\nRole::Tiny->createclasswithroles('Some::Base', qw(Some::Role1 Some::Role2));\n\nCreates a new class based on base, with the roles composed into it in order. New class is\nreturned.\n\nisrole\nRole::Tiny->isrole('Some::Role1')\n\nReturns true if the given package is a role.\n",
                "subsections": []
            },
            "CAVEATS": {
                "content": "*   On perl 5.8.8 and earlier, applying a role to an object won't apply any overloads from the\nrole to other copies of the object.\n\n*   On perl 5.16 and earlier, applying a role to a class won't apply any overloads from the role\nto any existing instances of the class.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "Role::Tiny is the attribute-less subset of Moo::Role; Moo::Role is a meta-protocol-less subset\nof the king of role systems, Moose::Role.\n\nOvid's Role::Basic provides roles with a similar scope, but without method modifiers, and having\nsome extra usage restrictions.\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "mst - Matt S. Trout (cpan:MSTROUT) <mst@shadowcat.co.uk>\n",
                "subsections": []
            },
            "CONTRIBUTORS": {
                "content": "dg - David Leadbeater (cpan:DGL) <dgl@dgl.cx>\n\nfrew - Arthur Axel \"fREW\" Schmidt (cpan:FREW) <frioux@gmail.com>\n\nhobbs - Andrew Rodland (cpan:ARODLAND) <arodland@cpan.org>\n\njnap - John Napiorkowski (cpan:JJNAPIORK) <jjn1056@yahoo.com>\n\nribasushi - Peter Rabbitson (cpan:RIBASUSHI) <ribasushi@cpan.org>\n\nchip - Chip Salzenberg (cpan:CHIPS) <chip@pobox.com>\n\najgb - Alex J. G. Burzyński (cpan:AJGB) <ajgb@cpan.org>\n\ndoy - Jesse Luehrs (cpan:DOY) <doy at tozt dot net>\n\nperigrin - Chris Prather (cpan:PERIGRIN) <chris@prather.org>\n\nMithaldu - Christian Walde (cpan:MITHALDU) <walde.christian@googlemail.com>\n\nilmari - Dagfinn Ilmari Mannsåker (cpan:ILMARI) <ilmari@ilmari.org>\n\ntobyink - Toby Inkster (cpan:TOBYINK) <tobyink@cpan.org>\n\nhaarg - Graham Knop (cpan:HAARG) <haarg@haarg.org>\n",
                "subsections": []
            },
            "COPYRIGHT": {
                "content": "Copyright (c) 2010-2012 the Role::Tiny \"AUTHOR\" and \"CONTRIBUTORS\" as listed above.\n",
                "subsections": []
            },
            "LICENSE": {
                "content": "This library is free software and may be distributed under the same terms as perl itself.\n",
                "subsections": []
            }
        }
    }
}