Bubblegum::Object::Universal - Common Methods for Operating on Defined Values
version 0.09
use Bubblegum; my $thing = 0; $thing->instance; # bless({'data' => 0}, 'Bubblegum::Object::Instance')
Universal methods work on variables whose data meets the criteria for being defined.
my $thing = 0; $thing->instance; # bless({'data' => 0}, 'Bubblegum::Object::Instance') my $data = $thing->instance->data; # 0
The instance method blesses the subject into a generic container class, Bubblegum::Object::Instance, and returns an instance. Please see Bubblegum::Object::Instance for more information.
my $thing = [1,0]; $thing->wrapper('json'); # same as ... $thing->json; # bless({'data' => [1,0]}, 'Bubblegum::Wrapper::Json') my $json = $thing->json->encode; # [1,0]
The wrapper method blesses the subject into a Bubblegum wrapper, a container class, which exists as an extension to the core data type methods, and returns an instance. Please see any one of the core Bubblegum wrappers, e.g., Bubblegum::Wrapper::Digest, Bubblegum::Wrapper::Dumper, Bubblegum::Wrapper::Encoder, Bubblegum::Wrapper::Json or Bubblegum::Wrapper::Yaml.
Al Newkirk <anewkirk@ana.io>
This software is copyright (c) 2013 by Al Newkirk.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Bubblegum, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Bubblegum
CPAN shell
perl -MCPAN -e shell install Bubblegum
For more information on module installation, please visit the detailed CPAN module installation guide.