Lines Matching defs:meta
12 our @EXPORT = qw/meta set_meta get_meta delete_meta/;
31 my $meta = $self->{+META_KEY} or return undef;
32 return $meta->{$key};
41 my $meta = $self->{+META_KEY} or return undef;
42 delete $meta->{$key};
45 sub meta {
51 my $meta = $self->{+META_KEY};
52 return undef unless $meta || defined($default);
54 unless($meta) {
55 $meta = {};
56 $self->{+META_KEY} = $meta;
59 $meta->{$key} = $default
60 if defined($default) && !defined($meta->{$key});
62 return $meta->{$key};
84 Test2::Util::ExternalMeta - Allow third party tools to safely attach meta-data
90 tools to attach meta-data to your instances. If your object consumes this
91 package, and imports its methods, then third party meta-data has a safe place
100 use Test2::Util::ExternalMeta qw/meta get_meta set_meta delete_meta/;
114 that is not true. It will store all meta-data in the C<_meta> key on your
122 =item $val = $obj->meta($key)
124 =item $val = $obj->meta($key, $default)
126 This will get the value for a specified meta C<$key>. Normally this will return
132 This will get the value for a specified meta C<$key>. This does not have the
133 C<$default> overhead that C<meta()> does.
137 This will remove the value of a specified meta C<$key>. The old C<$val> will be
142 Set the value of a specified meta C<$key>.