-
-
07 Apr 2009 15:33:51 UTC
- Distribution: Class-Implant
- Module version: 0.01
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues
- Testers (714 / 0 / 22)
- Kwalitee
Bus factor: 0- 98.04% Coverage
- License: mit
- Activity
24 month- Tools
- Download (3.17KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- Class::Inspector
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Class::Implant - Manipulating mixin and inheritance out of packages
VERSION
version 0.01
SYNOPSIS
There are two ways to use Class::Implant.
procedural way as follow.
package main; use Class::Implant; implant qw(Foo::Bar Less::More) { into => "Cat" } # import all methods in Foo::Bar and Less::More into Cat
or in classical way. just using caller as default target for implanting.
package Cat; use Class::Implant; implant qw(Less::More); # mixing all methods from Less::More, # like ruby 'include' implant qw(Foo::Bar), { inherit => 1 }; # import all methods from Foo::Bar and inherit it # it just do one more step: unshift Foo::Bar into @ISA # this step is trivial in Perl # but present a verisimilitude simulation of inheritance in Ruby
DESCRIPTION
Class::Implant allow you manipulating mixin and inheritance outside of packages.
syntax is like
use Class::Implant; implant @classes_for_injection, { options => value }
available options show as following.
into
target package for injection.
inherit
give 1 or any value to mark the inheritance
include
this option is not available in 0.01
exclude
this option is not available in 0.01
EXPORT
implant()
AUTHOR
shelling <shelling@cpan.org>
COPYRIGHT AND LICENSE
This software is Copyright (c) 2009 by shelling <shelling@cpan.org>.
This is free software, licensed under:
The MIT (X11) License
Module Install Instructions
To install Class::Implant, copy and paste the appropriate command in to your terminal.
cpanm Class::Implant
perl -MCPAN -e shell install Class::Implant
For more information on module installation, please visit the detailed CPAN module installation guide.