{
    "content": [
        {
            "type": "text",
            "text": "# Moose::Meta::Attribute::Native::Trait::Counter (perldoc)\n\n## NAME\n\nMoose::Meta::Attribute::Native::Trait::Counter - Helper trait for Int attributes which represent counters\n\n## SYNOPSIS\n\npackage MyHomePage;\nuse Moose;\nhas 'counter' => (\ntraits  => ['Counter'],\nis      => 'ro',\nisa     => 'Num',\ndefault => 0,\nhandles => {\ninccounter   => 'inc',\ndeccounter   => 'dec',\nresetcounter => 'reset',\n},\n);\nmy $page = MyHomePage->new();\n$page->inccounter;    # same as $page->counter( $page->counter + 1 );\n$page->deccounter;    # same as $page->counter( $page->counter - 1 );\nmy $countbytwos = 2;\n$page->inccounter($countbytwos);\n\n## DESCRIPTION\n\nThis trait provides native delegation methods for counters. A counter can be any sort of number\n(integer or not). The delegation methods allow you to increment, decrement, or reset the value.\n\n## Sections\n\n- **NAME**\n- **VERSION**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **DEFAULT TYPE**\n- **PROVIDED METHODS**\n- **BUGS**\n- **AUTHORS**\n- **COPYRIGHT AND LICENSE**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Moose::Meta::Attribute::Native::Trait::Counter",
        "section": "",
        "mode": "perldoc",
        "summary": "Moose::Meta::Attribute::Native::Trait::Counter - Helper trait for Int attributes which represent counters",
        "synopsis": "package MyHomePage;\nuse Moose;\nhas 'counter' => (\ntraits  => ['Counter'],\nis      => 'ro',\nisa     => 'Num',\ndefault => 0,\nhandles => {\ninccounter   => 'inc',\ndeccounter   => 'dec',\nresetcounter => 'reset',\n},\n);\nmy $page = MyHomePage->new();\n$page->inccounter;    # same as $page->counter( $page->counter + 1 );\n$page->deccounter;    # same as $page->counter( $page->counter - 1 );\nmy $countbytwos = 2;\n$page->inccounter($countbytwos);",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "VERSION",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 22,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "DEFAULT TYPE",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "PROVIDED METHODS",
                "lines": 28,
                "subsections": []
            },
            {
                "name": "BUGS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "AUTHORS",
                "lines": 20,
                "subsections": []
            },
            {
                "name": "COPYRIGHT AND LICENSE",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Moose::Meta::Attribute::Native::Trait::Counter - Helper trait for Int attributes which represent\ncounters\n",
                "subsections": []
            },
            "VERSION": {
                "content": "version 2.2200\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "package MyHomePage;\nuse Moose;\n\nhas 'counter' => (\ntraits  => ['Counter'],\nis      => 'ro',\nisa     => 'Num',\ndefault => 0,\nhandles => {\ninccounter   => 'inc',\ndeccounter   => 'dec',\nresetcounter => 'reset',\n},\n);\n\nmy $page = MyHomePage->new();\n$page->inccounter;    # same as $page->counter( $page->counter + 1 );\n$page->deccounter;    # same as $page->counter( $page->counter - 1 );\n\nmy $countbytwos = 2;\n$page->inccounter($countbytwos);\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "This trait provides native delegation methods for counters. A counter can be any sort of number\n(integer or not). The delegation methods allow you to increment, decrement, or reset the value.\n",
                "subsections": []
            },
            "DEFAULT TYPE": {
                "content": "If you don't provide an \"isa\" value for your attribute, it will default to \"Num\".\n",
                "subsections": []
            },
            "PROVIDED METHODS": {
                "content": "*   set($value)\n\nSets the counter to the specified value and returns the new value.\n\nThis method requires a single argument.\n\n*   inc\n\n*   inc($arg)\n\nIncreases the attribute value by the amount of the argument, or by 1 if no argument is\ngiven. This method returns the new value.\n\nThis method accepts a single argument.\n\n*   dec\n\n*   dec($arg)\n\nDecreases the attribute value by the amount of the argument, or by 1 if no argument is\ngiven. This method returns the new value.\n\nThis method accepts a single argument.\n\n*   reset\n\nResets the value stored in this slot to its default value, and returns the new value.\n",
                "subsections": []
            },
            "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": []
            }
        }
    }
}