Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
Class::Mixin(3)	      User Contributed Perl Documentation      Class::Mixin(3)

NAME
       Class::Mixin - API for aliasing methods to/from other classes

OVERVIEW
       Class::Mixin provides a way to mix methods from one class into another,
       such that the target class can use both its methods as well as those of
       the source class.

       The primary advantage is	that the behavior of a class can be modified
       to effectively be another class without changing	any of the calling
       code -- just requires using the new class that mixes into the original.

SYNOPSIS
	 # class1.pm
	 package class1;
	 sub sub1 { return 11 };
	 ...

	 # class2.pm
	 package class2;
	 use Class::Mixin to=> 'class1';
	 sub sub2 { return 22 };

	 # Original calling code
	 use class1;
	 print class1->sub1;  #	11
	 print class1->can('sub2');  # false

	 # Updated calling code
	 use class1;
	 use class2;   # performs the mixing-in
	 print class1->sub1;  #	11
	 print class1->can('sub2');  # true
	 print class1->sub2;  #	22  <--	note class1 now	has the	class2 method

METHODS
   import
       Method used when	loading	class to import	symbols	or perform some
       function.  In this case we take the calling classes methods and map
       them into the class passed in as	a parameter.

       Input
	 None
       Output
	 None

   Destructor DESTROY
       This modules uses a destructor for un-mixing methods.  This is done in
       the case	that this module is unloaded for some reason.  It will return
       modules to their	original states.

       Input
	 o Class::Mixin	object

       Output
	 None

   resync
       Function	used to	process	registered 'mixins'.  Typically	automatically
       called once immediately after program compilation.  Sometimes though
       you may want to call it manually	if a modules is	reloaded.

       Input
	 None
       Output
	 None

AUTHORS
       o Stathy	G. Touloumis <stathy@stathy.com>

       o David Westbrook <dwestbrook@gmail.com>

BUGS
       Please report any bugs or feature requests to "bug-class-mixin at
       rt.cpan.org", or	through	the web	interface at
       <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Class-Mixin>.  I	will
       be notified, and	then you'll automatically be notified of progress on
       your bug	as I make changes.

SUPPORT
       You can find documentation for this module with the perldoc command.

	   perldoc Class::Mixin

       You can also look for information at:

       o   RT: CPAN's request tracker

	   <http://rt.cpan.org/NoAuth/Bugs.html?Dist=Class-Mixin>

       o   AnnoCPAN: Annotated CPAN documentation

	   <http://annocpan.org/dist/Class-Mixin>

       o   CPAN	Ratings

	   <http://cpanratings.perl.org/d/Class-Mixin>

       o   Search CPAN

	   <http://search.cpan.org/dist/Class-Mixin>

COPYRIGHT AND LICENSE
       Copyright (C) 2003-2008 Stathy G. Touloumis

       This is free software; you can redistribute it and/or modify it under
       the same	terms as Perl itself.

perl v5.24.1			  2008-05-26		       Class::Mixin(3)

NAME | OVERVIEW | SYNOPSIS | METHODS | AUTHORS | BUGS | SUPPORT | COPYRIGHT AND LICENSE

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=Class::Mixin&sektion=3&manpath=FreeBSD+12.0-RELEASE+and+Ports>

home | help