« blib/lib/Class/MakeMethods/Template/Scalar.pm
↑ Summary
blib/lib/Class/MakeMethods/Template/Flyweight.pm »
| 1 | =head1 NAME | ||
| 2 | |||
| 3 | Class::MakeMethods::Standard - Make common object accessors | ||
| 4 | |||
| 5 | |||
| 6 | =head1 SYNOPSIS | ||
| 7 | |||
| 8 | package MyObject; | ||
| 9 | use Class::MakeMethods::Standard::Hash ( | ||
| 10 | new => 'new', | ||
| 11 | scalar => [ 'foo', 'bar' ], | ||
| 12 | array => 'my_list', | ||
| 13 | hash => 'my_index', | ||
| 14 | ); | ||
| 15 | |||
| 16 | |||
| 17 | =head1 DESCRIPTION | ||
| 18 | |||
| 19 | This document describes the various subclasses of Class::MakeMethods | ||
| 20 | included under the Standard::* namespace, and the method types each | ||
| 21 | one provides. | ||
| 22 | |||
| 23 | The Standard subclasses provide a parameterized set of method-generation | ||
| 24 | implementations. | ||
| 25 | |||
| 26 | Subroutines are generated as closures bound to a hash containing | ||
| 27 | the method name and (optionally) additional parameters. | ||
| 28 | |||
| 29 | |||
| 30 | =head1 USAGE AND SYNTAX | ||
| 31 | |||
| 32 | When you C<use> a subclass of this package, the method declarations | ||
| 33 | you provide as arguments cause subroutines to be generated and | ||
| 34 | installed in your module. You can also omit the arguments to C<use> | ||
| 35 | and instead make methods at runtime by passing the declarations to | ||
| 36 | a subsequent call to C<make()>. | ||
| 37 | |||
| 38 | You may include any number of declarations in each call to C<use> | ||
| 39 | or C<make()>. If methods with the same name already exist, earlier | ||
| 40 | calls to C<use> or C<make()> win over later ones, but within each | ||
| 41 | call, later declarations superceed earlier ones. | ||
| 42 | |||
| 43 | You can install methods in a different package by passing | ||
| 44 | C<-target_class =E<gt> I<package>> as your first arguments to C<use> | ||
| 45 | or C<make>. | ||
| 46 | |||
| 47 | See L<Class::MakeMethods/"USAGE"> for more details. | ||
| 48 | |||
| 49 | =cut | ||
| 50 | |||
| 51 | package Class::MakeMethods::Standard; | ||
| 52 | |||
| 53 | 11 | $VERSION = 1.000; | |
| 54 | 11 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 55 | 11 | ▶ | use Class::MakeMethods '-isasubclass'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 56 | |||
| 57 | ######################################################################## | ||
| 58 | |||
| 59 | =head1 SEE ALSO | ||
| 60 | |||
| 61 | See L<Class::MakeMethods> for general information about this distribution. | ||
| 62 | |||
| 63 | For distribution, installation, support, copyright and license | ||
| 64 | information, see L<Class::MakeMethods::Docs::ReadMe>. | ||
| 65 | |||
| 66 | =cut | ||
| 67 | |||
| 68 | 11 | 1; | |