NAME
Class::MakeMethods::Template::Static - Method that are not instance-dependent
SYNOPSIS
package MyObject;
use Class::MakeMethods::Template::Static (
scalar => [ 'foo' ]
);
package main;
MyObject->foo('bar')
print MyObject->foo();
DESCRIPTION
These meta-methods access values that are shared across all instances of your object in your process. For example, a hash_scalar meta-method will be able to store a different value for each hash instance you call it on, but a static_scalar meta-method will return the same value for any instance it's called on, and setting it from any instance will change the value that all other instances see.
Common Parameters: The following parameters are defined for Static meta-methods.
- data
-
The shared value.
Template::Static:scalar
Creates accessor methods each of which shares a single scalar value.
See the documentation on Generic:scalar
for interfaces and behaviors.
Template::Static:array
Creates accessor methods, each of which shares a single array-ref value.
See the documentation on Generic:array
for interfaces and behaviors.
Template::Static:hash
Creates accessor methods, each of which shares a single hash-ref value.
See the documentation on Generic:hash
for interfaces and behaviors.
Template::Static:tiedhash
A variant of Template::Static:hash which initializes the hash by tieing it to a caller-specified package.
See the documentation on Generic:tiedhash
for interfaces and behaviors, and for required additional parameters.
Template::Static:hash_of_arrays
Creates accessor methods, each of which shares a reference to a single hash of array-refs.
See the documentation on Generic:hash_of_arrays
for interfaces and behaviors.
Template::Static:code
Creates methods which contain an subroutine reference.
See the documentation on Generic:code
for interfaces, behaviors, and parameters.
Template::Static:instance
Creates methods to handle a single instance of the calling class.
See the documentation on Generic:instance
for interfaces and behaviors.
SEE ALSO
Class::MakeMethods