Class-MakeMethods

 view release on metacpan or  search on metacpan

MakeMethods/Utility/Inheritable.pm  view on Meta::CPAN

22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
    
  get_vvalue($dataset, $obj);                   # Objects "inherit"
  set_vvalue($dataset, $obj, 'Foible');         # Until you override
  get_vvalue($dataset, $obj);                   # Now finds "Foible"
   
  get_vvalue($dataset, 'MySubclass');           # Subclass "inherits"
  get_vvalue($dataset, $subobj);                # As do its objects
  set_vvalue($dataset, 'MySubclass', 'Foozle'); # Until we override it
  get_vvalue($dataset, 'MySubclass');           # Now finds "Foozle"
   
  get_vvalue($dataset, $subobj);                # Change cascades down
  set_vvalue($dataset, $subobj, 'Foolish');     # Until we override again
   
  get_vvalue($dataset, 'MyClass');              # Superclass is unchanged
 
=head1 DESCRIPTION
 
This module provides several functions which allow you to store values in a hash corresponding to both objects and classes, and to retrieve those values by searching a object's inheritance tree until it finds a matching entry.
 
This functionality is used by Class::MakeMethods::Standard::Inheritable and Class::MakeMethods::Composite::Inheritable to construct methods that can both store class data and be overriden on a per-object level.



( run in 0.262 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )