SEARCH
NEW RPMS
DIRECTORIES
ABOUT
FAQ
VARIOUS
BLOG
DONATE


YUM REPOSITORY

 
 

MAN page from Fedora 28 perl-Class-MakeMethods-1.009-11.fc28.noarch.rpm

MakeMethods::Composite

Section: User Contributed Perl Documentation (3)
Updated: 2003-09-06
Index 

NAME

Class::MakeMethods::Composite - Make extensible compound methods 

SYNOPSIS

  package MyObject;  use Class::MakeMethods::Composite::Hash (    new => 'new',    scalar => [ 'foo', 'bar' ],    array => 'my_list',    hash => 'my_index',  );
 

DESCRIPTION

This document describes the various subclasses of Class::MakeMethodsincluded under the Composite::* namespace, and the method types eachone provides.

The Composite subclasses provide a parameterized set of method-generationimplementations.

Subroutines are generated as closures bound to a hash containingthe method name and additional parameters, including the arrays of subroutine references that will provide the method's functionality. 

Calling Conventions

When you "use" this package, the method names you provideas arguments cause subroutines to be generated and installed inyour module.

See ``Calling Conventions'' in Class::MakeMethods::Standard for more information. 

Declaration Syntax

To declare methods, pass in pairs of a method-type name followedby one or more method names.

Valid method-type names for this package are listed in ``METHODGENERATOR TYPES''.

See ``Declaration Syntax'' in Class::MakeMethods::Standard and ``Parameter Syntax'' in Class::MakeMethods::Standard for more information. 

About Composite Methods

The methods generated by Class::MakeMethods::Composite are assembledfrom groups of ``fragment'' subroutines, each of which provides someaspect of the method's behavior.

You can add pre- and post- operations to any composite method.

  package MyObject;  use Class::MakeMethods::Composite::Hash (    new => 'new',    scalar => [       'foo' => {         'pre_rules' => [           sub {            # Don't automatically convert list to array-ref            croak "Too many arguments" if ( scalar @_ > 2 );          }        ],        'post_rules' => [           sub {            # Don't let anyone see my credit card number!            ${(pop)->{result}} =~ s/\d{13,16}/****/g;          }        ],      }    ],  );
 

SEE ALSO

See Class::MakeMethods for general information about this distribution.


 

Index

NAME
SYNOPSIS
DESCRIPTION
Calling Conventions
Declaration Syntax
About Composite Methods
SEE ALSO

This document was created byman2html,using the manual pages.