Class-Data-Annotated
view release on metacpan or search on metacpan
lib/Class/Data/Annotated.pm view on Meta::CPAN
=head1 SYNOPSIS
use Class::Data::Annotated;
my $$obj = Class::Data::Annotated->new();
=cut
our $VERSION = '0.2';
my $callbacks = {
key_does_not_exist => sub {},
index_does_not_exist => sub {},
retrieve_index_from_non_array => sub {},
retrieve_key_from_non_hash => sub {},
};
=head1 METHODS
=head2 new()
instantiate an Annotated Data Structure
=cut
sub new {
my ($class, $struct) = @_;
croak('I just gotta have data') unless $struct;
return bless {Annotations => Data::Annotated->new(), Data => Data::Path->new($struct, $callbacks)}, $class;
}
=head2 annotate($path, \%annotation)
annotate a peice of the data. if that piece does not exist it will return undef. Otherwise it returns the data annotated.
=cut
sub annotate {
my ($self, $path, $annotation) = @_;
( run in 0.483 second using v1.01-cache-2.11-cpan-9b1e4054eb1 )