MakeMe...Inherit(3pm)
okay bestie, welcome to the MakeMe...Inherit(3pm) page β itβs a User Contributed Perl Documentation page for Class::MakeMethods::Template::ClassInherit β¨. Buckle up, weβre doing overridable class data π
.
π NAME π
Class::MakeMethods::Template::ClassInherit β Overridable class data πΈ
π¦ SYNOPSIS π¦
package MyClass;
use Class::MakeMethods( 'Template::ClassInherit:scalar' => 'foo' );
# We now have an accessor method for an "inheritable" scalar value
package main;
MyClass->foo( 'Foozle' ); # Set a class-wide value
print MyClass->foo(); # Retrieve class-wide value
...
package MySubClass;
@ISA = 'MyClass';
print MySubClass->foo(); # Initially same as superclass,
MySubClass->foo('Foobar'); # but overridable per subclass/
π₯ DESCRIPTION π₯
The MakeMethods subclass is giving accessor methods that search an inheritance tree to find a value. Translation: you can set a shared or default value for a given class, and optionally override it in a subclass. Itβs literally the βfamily recipe, but you can tweak it in your own kitchenβ vibe π.
π Standard Methods π
The following methods from Generic should all be supported:
scalarstringstring_index (?)numberbooleanbits (?)array (*)hash (*)tiedhash (?)hash_of_arrays (?)object (?)instance (?)array_of_objects (?)code (?)code_or_scalar (?)
See Class::MakeMethods::Template::Generic for the interfaces and behaviors of these method types. π
The items marked with a * above are specifically defined in this package, whereas the others are formed automatically by the interaction of this package's generic settings with the code templates provided by the Generic superclass. β¨
Heads up bestie: the items marked with a ? above have not been tested sufficiently; please inform the author if they do not function as you would expect. π
π«Ά SEE ALSO π«Ά
- See
Class::MakeMethodsfor general information about this distribution. π - See
Class::MakeMethods::Templatefor more about this family of subclasses. π¦ - See
Class::MakeMethods::Template::Genericfor information about the various accessor interfaces subclassed herein. πΈ - If you just need scalar accessors, see
Class::Data::Inheritablefor a very elegant and efficient implementation. β¨
k bye bestie π β this MakeMe...Inherit(3pm) page is from perl v5.36.0, dated 2022-10-13. periodt. π
π¦ where this page comes from
- ubuntu noble: libclass-makemethods-perl 1.01-7 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libclass-makemethods-perl 1.01-7 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libclass-makemethods-perl 1.01-7 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms