Data-Annotation
view release on metacpan or search on metacpan
lib/Data/Annotation.pod view on Meta::CPAN
my $retval = $da->default_retval;
The default result (annotation) value returned when none of the rules
that are checked as part of a call to L</evaluate> provides anything
meaningful back.
Initialized by key C<default> in the constructor.
=head3 B<< description >>
my $text = $da->description;
An optional description for the Data::Annotation definition. It will be
useful for you in a couple of months, after you forgot everything about
it.
=head3 B<< parse_context >>
my $ctx = $da->parse_context;
Whatever was passed as argument C<condition-parse-context>, which can
help set the stage for condition parsing. This should not be generally
needed, but still. See L<Data::Annotation::Expression> for more details.
=head2 Methods
=head3 B<< chains_list >>
Get the sorted list of chains (as strings).
=head3 B<< evaluate >>
my $result = $da->evaluate($chain_name, $data);
Evaluate the annotation for some C<$data>, starting at chain named
C<$chain_name>.
=head3 B<< has_chain_for >>
my $bool = $da->has_chain_for($chain_name);
Check if there is a chain definition whose name is C<< $chain_name >>o
=head3 B<< inflate_chains >>
$da->inflate_chains;
Make sure all input chain definitions are I<inflated>, i.e. turned into
L</Data::Annotation::Chain> objects. This makes sure the definitions
parse correctly.
=head3 B<< overlay_cloak >>
my $overlay = $da->overlay_cloak($data, %opts);
Shorthand to the constructor for L</Data::Annotation::Overlay>, passing
C<$data> as the C<under> option and then the rest of C<%opts>:
=head1 BUGS AND LIMITATIONS
Minimul perl version 5.24.
Report bugs through Codeberg (patches welcome) at
L<https://codeberg.org/polettix/Data-Annotation>.
=head1 AUTHOR
Flavio Poletti <flavio@polettix.it>
=head1 COPYRIGHT AND LICENSE
Copyright 2024 by Flavio Poletti <flavio@polettix.it>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Just to be clear: apache-2.0
=cut
( run in 0.406 second using v1.01-cache-2.11-cpan-39bf76dae61 )