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


Object-Capsule documentation  | view source Contained in the Object-Capsule distribution.

Index


NAME

Top

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

VERSION

Top

version 0.011

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

SYNOPSIS

Top

 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

Top

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

Top

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

Top

Ricardo Signes, <rjbs@cpan.org>

BUGS

Top

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

Top

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

Top


Object-Capsule documentation  | view source Contained in the Object-Capsule distribution.