{
    "content": [
        {
            "type": "text",
            "text": "# Moo::Role (perldoc)\n\n## NAME\n\nMoo::Role - Minimal Object Orientation support for Roles\n\n## SYNOPSIS\n\npackage My::Role;\nuse Moo::Role;\nuse strictures 2;\nsub foo { ... }\nsub bar { ... }\nhas baz => (\nis => 'ro',\n);\n1;\nAnd elsewhere:\npackage Some::Class;\nuse Moo;\nuse strictures 2;\n# bar gets imported, but not foo\nwith 'My::Role';\nsub foo { ... }\n1;\n\n## DESCRIPTION\n\n\"Moo::Role\" builds upon Role::Tiny, so look there for most of the documentation on how this\nworks (in particular, using \"Moo::Role\" also enables strict and warnings). The main addition\nhere is extra bits to make the roles more \"Moosey;\" which is to say, it adds \"has\".\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **IMPORTED SUBROUTINES**\n- **CLEANING UP IMPORTS**\n- **SUPPORT**\n- **AUTHORS**\n- **COPYRIGHT AND LICENSE**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Moo::Role",
        "section": "",
        "mode": "perldoc",
        "summary": "Moo::Role - Minimal Object Orientation support for Roles",
        "synopsis": "package My::Role;\nuse Moo::Role;\nuse strictures 2;\nsub foo { ... }\nsub bar { ... }\nhas baz => (\nis => 'ro',\n);\n1;\nAnd elsewhere:\npackage Some::Class;\nuse Moo;\nuse strictures 2;\n# bar gets imported, but not foo\nwith 'My::Role';\nsub foo { ... }\n1;",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 29,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "IMPORTED SUBROUTINES",
                "lines": 10,
                "subsections": []
            },
            {
                "name": "CLEANING UP IMPORTS",
                "lines": 23,
                "subsections": []
            },
            {
                "name": "SUPPORT",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "AUTHORS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "COPYRIGHT AND LICENSE",
                "lines": 2,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Moo::Role - Minimal Object Orientation support for Roles\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "package My::Role;\n\nuse Moo::Role;\nuse strictures 2;\n\nsub foo { ... }\n\nsub bar { ... }\n\nhas baz => (\nis => 'ro',\n);\n\n1;\n\nAnd elsewhere:\n\npackage Some::Class;\n\nuse Moo;\nuse strictures 2;\n\n# bar gets imported, but not foo\nwith 'My::Role';\n\nsub foo { ... }\n\n1;\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "\"Moo::Role\" builds upon Role::Tiny, so look there for most of the documentation on how this\nworks (in particular, using \"Moo::Role\" also enables strict and warnings). The main addition\nhere is extra bits to make the roles more \"Moosey;\" which is to say, it adds \"has\".\n",
                "subsections": []
            },
            "IMPORTED SUBROUTINES": {
                "content": "See \"IMPORTED SUBROUTINES\" in Role::Tiny for all the other subroutines that are imported by this\nmodule.\n\nhas\nhas attr => (\nis => 'ro',\n);\n\nDeclares an attribute for the class to be composed into. See \"has\" in Moo for all options.\n",
                "subsections": []
            },
            "CLEANING UP IMPORTS": {
                "content": "Moo::Role cleans up its own imported methods and any imports declared before the \"use Moo::Role\"\nstatement automatically. Anything imported after \"use Moo::Role\" will be composed into consuming\npackages. A package that consumes this role:\n\npackage My::Role::ID;\n\nuse Digest::MD5 qw(md5hex);\nuse Moo::Role;\nuse Digest::SHA qw(sha1hex);\n\nrequires 'name';\n\nsub asmd5  { my ($self) = @; return md5hex($self->name);  }\nsub assha1 { my ($self) = @; return sha1hex($self->name); }\n\n1;\n\n..will now have a \"$self->sha1hex()\" method available to it that probably does not do what you\nexpect. On the other hand, a call to \"$self->md5hex()\" will die with the helpful error message:\n\"Can't locate object method \"md5hex\"\".\n\nSee \"CLEANING UP IMPORTS\" in Moo for more details.\n",
                "subsections": []
            },
            "SUPPORT": {
                "content": "See Moo for support and contact information.\n",
                "subsections": []
            },
            "AUTHORS": {
                "content": "See Moo for authors.\n",
                "subsections": []
            },
            "COPYRIGHT AND LICENSE": {
                "content": "See Moo for the copyright and license.\n",
                "subsections": []
            }
        }
    }
}