{
    "content": [
        {
            "type": "text",
            "text": "# Class::Data::Inheritable (perldoc)\n\n## NAME\n\nClass::Data::Inheritable - Inheritable, overridable class data\n\n## SYNOPSIS\n\npackage Stuff;\nuse base qw(Class::Data::Inheritable);\n# Set up DataFile as inheritable class data.\nStuff->mkclassdata('DataFile');\n# Declare the location of the data file for this class.\nStuff->DataFile('/etc/stuff/data');\n# Or, all in one shot:\nStuff->mkclassdata(DataFile => '/etc/stuff/data');\n\n## DESCRIPTION\n\nClass::Data::Inheritable is for creating accessor/mutators to class data. That is, if you want\nto store something about your class as a whole (instead of about a single object). This data is\nthen inherited by your subclasses and can be overridden.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **Methods**\n- **AUTHOR**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Class::Data::Inheritable",
        "section": "",
        "mode": "perldoc",
        "summary": "Class::Data::Inheritable - Inheritable, overridable class data",
        "synopsis": "package Stuff;\nuse base qw(Class::Data::Inheritable);\n# Set up DataFile as inheritable class data.\nStuff->mkclassdata('DataFile');\n# Declare the location of the data file for this class.\nStuff->DataFile('/etc/stuff/data');\n# Or, all in one shot:\nStuff->mkclassdata(DataFile => '/etc/stuff/data');",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 12,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 43,
                "subsections": []
            },
            {
                "name": "Methods",
                "lines": 20,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 16,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Class::Data::Inheritable - Inheritable, overridable class data\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "package Stuff;\nuse base qw(Class::Data::Inheritable);\n\n# Set up DataFile as inheritable class data.\nStuff->mkclassdata('DataFile');\n\n# Declare the location of the data file for this class.\nStuff->DataFile('/etc/stuff/data');\n\n# Or, all in one shot:\nStuff->mkclassdata(DataFile => '/etc/stuff/data');\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "Class::Data::Inheritable is for creating accessor/mutators to class data. That is, if you want\nto store something about your class as a whole (instead of about a single object). This data is\nthen inherited by your subclasses and can be overridden.\n\nFor example:\n\nPere::Ubu->mkclassdata('Suitcase');\n\nwill generate the method Suitcase() in the class Pere::Ubu.\n\nThis new method can be used to get and set a piece of class data.\n\nPere::Ubu->Suitcase('Red');\n$suitcase = Pere::Ubu->Suitcase;\n\nThe interesting part happens when a class inherits from Pere::Ubu:\n\npackage Raygun;\nuse base qw(Pere::Ubu);\n\n# Raygun's suitcase is Red.\n$suitcase = Raygun->Suitcase;\n\nRaygun inherits its Suitcase class data from Pere::Ubu.\n\nInheritance of class data works analogous to method inheritance. As long as Raygun does not\n\"override\" its inherited class data (by using Suitcase() to set a new value) it will continue to\nuse whatever is set in Pere::Ubu and inherit further changes:\n\n# Both Raygun's and Pere::Ubu's suitcases are now Blue\nPere::Ubu->Suitcase('Blue');\n\nHowever, should Raygun decide to set its own Suitcase() it has now \"overridden\" Pere::Ubu and is\non its own, just like if it had overridden a method:\n\n# Raygun has an orange suitcase, Pere::Ubu's is still Blue.\nRaygun->Suitcase('Orange');\n\nNow that Raygun has overridden Pere::Ubu further changes by Pere::Ubu no longer effect Raygun.\n\n# Raygun still has an orange suitcase, but Pere::Ubu is using Samsonite.\nPere::Ubu->Suitcase('Samsonite');\n",
                "subsections": []
            },
            "Methods": {
                "content": "mkclassdata\nClass->mkclassdata($dataaccessorname);\nClass->mkclassdata($dataaccessorname => $value);\n\nThis is a class method used to declare new class data accessors. A new accessor will be created\nin the Class using the name from $dataaccessorname, and optionally initially setting it to the\ngiven value.\n\nTo facilitate overriding, mkclassdata creates an alias to the accessor, fieldaccessor(). So\nSuitcase() would have an alias Suitcaseaccessor() that does the exact same thing as\nSuitcase(). This is useful if you want to alter the behavior of a single accessor yet still get\nthe benefits of inheritable class data. For example.\n\nsub Suitcase {\nmy($self) = shift;\nwarn \"Fashion tragedy\" if @ and $[0] eq 'Plaid';\n\n$self->Suitcaseaccessor(@);\n}\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Original code by Damian Conway.\n\nMaintained by Michael G Schwern until September 2005.\n\nNow maintained by Tony Bowden.\n\nBUGS and QUERIES\nPlease direct all correspondence regarding this module to:\nbug-Class-Data-Inheritable@rt.cpan.org\n\nCOPYRIGHT and LICENSE\nCopyright (c) 2000-2005, Damian Conway and Michael G Schwern. All Rights Reserved.\n\nThis module is free software. It may be used, redistributed and/or modified under the same terms\nas Perl itself.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "perltooc has a very elaborate discussion of class data in Perl.\n",
                "subsections": []
            }
        }
    }
}