++ed by:

1 non-PAUSE user.

Al Newkirk

NAME

Bubblegum::Object::Universal - Common Methods for Operating on Defined Values

VERSION

version 0.26

SYNOPSIS

    use Bubblegum;

    my $thing = 0;
    $thing->instance; # bless({'data' => 0}, 'Bubblegum::Object::Instance')

DESCRIPTION

Universal methods work on variables whose data meets the criteria for being defined. It is not necessary to use this module as it is loaded automatically by the Bubblegum class.

METHODS

instance

    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.

wrapper

    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.

SEE ALSO

Bubblegum::Object::Array, Bubblegum::Object::Code, Bubblegum::Object::Hash, Bubblegum::Object::Instance, Bubblegum::Object::Integer, Bubblegum::Object::Number, Bubblegum::Object::Scalar, Bubblegum::Object::String, Bubblegum::Object::Undef, Bubblegum::Object::Universal,

AUTHOR

Al Newkirk <anewkirk@ana.io>

COPYRIGHT AND LICENSE

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.