{
    "content": [
        {
            "type": "text",
            "text": "# Moose::Cookbook::Extending::Mooseish_MooseSugar (info)\n\n## NAME\n\nMoose::Cookbook::Extending::MooseishMooseSugar - Acting like Moose.pm and providing sugar Moose-style\n\n## SYNOPSIS\n\npackage MyApp::Mooseish;\nuse Moose::Exporter;\nMoose::Exporter->setupimportmethods(\nwithmeta       => ['hastable'],\nclassmetaroles => {\nclass => ['MyApp::Meta::Class::Trait::HasTable'],\n},\n);\nsub hastable {\nmy $meta = shift;\n$meta->table(shift);\n}\npackage MyApp::Meta::Class::Trait::HasTable;\nuse Moose::Role;\nhas table => (\nis  => 'rw',\nisa => 'Str',\n);\n\n## DESCRIPTION\n\nThis recipe expands on the use of Moose::Exporter we saw in\nMoose::Cookbook::Extending::ExtensionOverview and the class metaclass\ntrait we saw in Moose::Cookbook::Meta::TableMetaclassTrait. In this\nexample we provide our own metaclass trait, and we also export a\n\"hastable\" sugar function.\n\n## Sections\n\n- **Moose::Cookbook::ExtenUserMoose::Cookbook::Extending::MooseishMooseSugar(3pm)**\n- **NAME**\n- **VERSION**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **CONCLUSION**\n- **AUTHORS**\n- **COPYRIGHT AND LICENSE**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Moose::Cookbook::Extending::Mooseish_MooseSugar",
        "section": "",
        "mode": "info",
        "summary": "Moose::Cookbook::Extending::MooseishMooseSugar - Acting like Moose.pm and providing sugar Moose-style",
        "synopsis": "package MyApp::Mooseish;\nuse Moose::Exporter;\nMoose::Exporter->setupimportmethods(\nwithmeta       => ['hastable'],\nclassmetaroles => {\nclass => ['MyApp::Meta::Class::Trait::HasTable'],\n},\n);\nsub hastable {\nmy $meta = shift;\n$meta->table(shift);\n}\npackage MyApp::Meta::Class::Trait::HasTable;\nuse Moose::Role;\nhas table => (\nis  => 'rw',\nisa => 'Str',\n);",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "Moose::Cookbook::ExtenUserMoose::Cookbook::Extending::MooseishMooseSugar(3pm)",
                "lines": 1,
                "subsections": []
            },
            {
                "name": "NAME",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "VERSION",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 24,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 31,
                "subsections": []
            },
            {
                "name": "CONCLUSION",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "AUTHORS",
                "lines": 20,
                "subsections": []
            },
            {
                "name": "COPYRIGHT AND LICENSE",
                "lines": 6,
                "subsections": []
            }
        ],
        "sections": {
            "Moose::Cookbook::ExtenUserMoose::Cookbook::Extending::MooseishMooseSugar(3pm)": {
                "content": "",
                "subsections": []
            },
            "NAME": {
                "content": "Moose::Cookbook::Extending::MooseishMooseSugar - Acting like Moose.pm\nand providing sugar Moose-style\n",
                "subsections": []
            },
            "VERSION": {
                "content": "version 2.2200\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "package MyApp::Mooseish;\n\nuse Moose::Exporter;\n\nMoose::Exporter->setupimportmethods(\nwithmeta       => ['hastable'],\nclassmetaroles => {\nclass => ['MyApp::Meta::Class::Trait::HasTable'],\n},\n);\n\nsub hastable {\nmy $meta = shift;\n$meta->table(shift);\n}\n\npackage MyApp::Meta::Class::Trait::HasTable;\nuse Moose::Role;\n\nhas table => (\nis  => 'rw',\nisa => 'Str',\n);\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "This recipe expands on the use of Moose::Exporter we saw in\nMoose::Cookbook::Extending::ExtensionOverview and the class metaclass\ntrait we saw in Moose::Cookbook::Meta::TableMetaclassTrait. In this\nexample we provide our own metaclass trait, and we also export a\n\"hastable\" sugar function.\n\nThe \"withmeta\" parameter specifies a list of functions that should be\nwrapped before exporting. The wrapper simply ensures that the importing\npackage's appropriate metaclass object is the first argument to the\nfunction, so we can do \"my$meta=shift;\".\n\nSee the Moose::Exporter docs for more details on its API.\n\nUSING MyApp::Mooseish\nThe purpose of all this code is to provide a Moose-like interface.\nHere's what it would look like in actual use:\n\npackage MyApp::User;\n\nuse namespace::autoclean;\n\nuse Moose;\nuse MyApp::Mooseish;\n\nhastable 'User';\n\nhas 'username' => ( is => 'ro' );\nhas 'password' => ( is => 'ro' );\n\nsub login { ... }\n",
                "subsections": []
            },
            "CONCLUSION": {
                "content": "Providing sugar functions can make your extension look much more Moose-\nish. See Fey::ORM for a more extensive example.\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              Moose::Cookbook::Extending::MooseishMooseSugar(3pm)",
                "subsections": []
            }
        }
    }
}