1MakeMethods::Template::UIsnehrerCiotnatbrlieb(u3t)ed PerMlakDeoMceutmheondtsa:t:iToenmplate::Inheritable(3)
2
3
4

NAME

6       Class::MakeMethods::Template::Inheritable - Overridable data
7

SYNOPSIS

9         package MyClass;
10
11         use Class::MakeMethods( 'Template::Inheritable:scalar' => 'foo' );
12         # We now have an accessor method for an "inheritable" scalar value
13
14         MyClass->foo( 'Foozle' );   # Set a class-wide value
15         print MyClass->foo();       # Retrieve class-wide value
16
17         my $obj = MyClass->new(...);
18         print $obj->foo();          # All instances "inherit" that value...
19
20         $obj->foo( 'Foible' );      # until you set a value for an instance.
21         print $obj->foo();          # This now finds object-specific value.
22         ...
23
24         package MySubClass;
25         @ISA = 'MyClass';
26
27         print MySubClass->foo();    # Intially same as superclass,
28         MySubClass->foo('Foobar');  # but overridable per subclass,
29         print $subclass_obj->foo(); # and shared by its instances
30         $subclass_obj->foo('Fosil');# until you override them...
31         ...
32

DESCRIPTION

34       The MakeMethods subclass provides accessor methods that search an
35       inheritance tree to find a value. This allows you to set a shared or
36       default value for a given class, and optionally override it in a
37       subclass.
38
39   Standard Methods
40       The following methods from Generic should be supported:
41
42         scalar
43         string
44         string_index (?)
45         number
46         boolean (?)
47         bits (?)
48         array (?)
49         hash (?)
50         tiedhash (?)
51         hash_of_arrays (?)
52         object (?)
53         instance (?)
54         array_of_objects (?)
55         code (?)
56         code_or_scalar (?)
57
58       See Class::MakeMethods::Template::Generic for the interfaces and
59       behaviors of these method types.
60
61       The items marked with a * above are specifically defined in this
62       package, whereas the others are formed automatically by the interaction
63       of this package's generic settings with the code templates provided by
64       the Generic superclass.
65
66       The items marked with a ? above have not been tested sufficiently;
67       please inform the author if they do not function as you would expect.
68

SEE ALSO

70       See Class::MakeMethods for general information about this distribution.
71
72       See Class::MakeMethods::Template for more about this family of
73       subclasses.
74
75       See Class::MakeMethods::Template::Generic for information about the
76       various accessor interfaces subclassed herein.
77
78       If you just need scalar accessors, see Class::Data::Inheritable for a
79       very elegant and efficient implementation.
80
81
82
83perl v5.32.1                      2021-01-M2a7keMethods::Template::Inheritable(3)
Impressum