Bubblegum
view release on metacpan or search on metacpan
lib/Bubblegum/Object/Universal.pm view on Meta::CPAN
# ABSTRACT: Common Methods for Operating on Defined Values
package Bubblegum::Object::Universal;
use 5.10.0;
use namespace::autoclean;
use Bubblegum::Namespace;
use Scalar::Util ();
use Types::Standard ();
use Class::Load 'load_class';
our @ISA = (); # non-object
my $TYPES = $Bubblegum::Namespace::ExtendedTypes;
our $VERSION = '0.45'; # VERSION
sub digest {
my $self = CORE::shift;
return wrapper($self, 'Digest');
}
sub dump {
my $self = CORE::shift;
return dumper($self)->encode;
}
sub dumper {
my $self = CORE::shift;
return wrapper($self, 'Dumper');
}
sub encoder {
my $self = CORE::shift;
return wrapper($self, 'Encoder');
}
sub instance {
my $self = CORE::shift;
my $class = $$TYPES{'INSTANCE'};
return load_class($class)->new(
data => $self
);
}
sub json {
my $self = CORE::shift;
return wrapper($self, 'Json');
}
sub refaddr {
return Scalar::Util::refaddr(
CORE::shift
);
}
sub reftype {
return Scalar::Util::reftype(
CORE::shift
);
}
sub wrapper {
my $self = CORE::shift;
( run in 0.961 second using v1.01-cache-2.11-cpan-0bb4e1dffa6 )