The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Object::Capsule - wrap any object in a flavorless capsule

VERSION

version 0.011

        $Id: /my/cs/projects/capsule/trunk/lib/Object/Capsule.pm 27815 2006-11-11T02:55:13.563463Z rjbs  $

SYNOPSIS

 use Object::Capsule;
 use Widget;

 my $widget = new Widget;

 my $capsule = encapsulate($widget);

 $capsule->some_widget_method; # performs method on widget

 print ref $capsule;  # prints "Object::Capsule"

 print ref $$capsule; # prints "Widget"

DESCRIPTION

An Object::Capsule is a thin, permeable membrane that fits nicely around an object. Method calls are passed on to the object, which functions normally inside the capsule. The object can be retrieved by dereferencing the capsule as a scalar.

My intent is to use an object capsule subclass to allow the inflation of multiple object types from a single column in Class::DBI.

FUNCTIONS

encapsulate($object)

This function encases the given object in an Object::Capsule and returns the capsule. It's exported by default and is otherwise non-existent.

AUTHOR

Ricardo Signes, <rjbs@cpan.org>

BUGS

Please report any bugs or feature requests to bug-object-capsule@rt.cpan.org, or through the web interface at http://rt.cpan.org. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

TODO

The proxy overloading code is hideous. The "future" version in the code had bizarre problems that I couldn't quite solve, but I'll try again sometime.

COPYRIGHT & LICENSE

Copyright 2004 Ricardo Signes, All Rights Reserved.

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