Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Perl Modules

    Class::MakeMethods::Composite 1.01

    Download button

    No screenshots available
    Downloads: 367  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Matthew Simon Cavalletto | More programs
    Perl Artistic License / FREE
    December 7th, 2007, 13:46 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    Class::MakeMethods::Composite description

    Class::MakeMethods::Composite is a Perl module to make extensible compound methods.

    Class::MakeMethods::Composite is a Perl module to make extensible compound methods.

    SYNOPSIS

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

    This document describes the various subclasses of Class::MakeMethods included under the Composite::* namespace, and the method types each one provides.

    The Composite subclasses provide a parameterized set of method-generation implementations.

    Subroutines are generated as closures bound to a hash containing the 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 provide as arguments cause subroutines to be generated and installed in your module.
    See "Calling Conventions" in Class::MakeMethods::Standard for more information.

    Declaration Syntax

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

    Valid method-type names for this package are listed in "METHOD GENERATOR 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 assembled from groups of "fragment" subroutines, each of which provides some aspect 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;
    }
    ],
    }
    ],
    );

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    compound methods | composite methods | Perl module | compound | Perl | class

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM