Bubblegum
view release on metacpan or search on metacpan
lib/Bubblegum/Prototype.pm view on Meta::CPAN
your superclasses, not add to them.
# replaces existing superclass with testing superclass
$film_search->proto->mixin(class => 'testing');
The mixin method, using the role key, modifies the subject using role
composition. Please note that applying a role will not overwrite existing
methods. If you desire to overwrite existing methods, please extend the object,
then apply the roles desired.
# add credentials and request methods dynamically
$film_search->proto->mixin(role => 'authorization');
$film_search->proto->mixin(role => 'advanced_search');
One of the very cool and interesting practices that this style of programming
encourages is modifying class definitions at runtime. This is achieved using
standard modern Perl object system operations. For example:
$shrek2->proto->make(quote => sub {
'Better out than in I always say'
});
( run in 0.264 second using v1.01-cache-2.11-cpan-4d50c553e7e )