Data-Annotation
view release on metacpan or search on metacpan
default_retval
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 "evaluate" provides anything
meaningful back.
Initialized by key default in the constructor.
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.
parse_context
my $ctx = $da->parse_context;
Whatever was passed as argument condition-parse-context, which can help
set the stage for condition parsing. This should not be generally
needed, but still. See Data::Annotation::Expression for more details.
Methods
chains_list
Get the sorted list of chains (as strings).
evaluate
my $result = $da->evaluate($chain_name, $data);
Evaluate the annotation for some $data, starting at chain named
$chain_name.
has_chain_for
my $bool = $da->has_chain_for($chain_name);
Check if there is a chain definition whose name is $chain_nameo
inflate_chains
$da->inflate_chains;
Make sure all input chain definitions are inflated, i.e. turned into
"Data::Annotation::Chain" objects. This makes sure the definitions
parse correctly.
overlay_cloak
my $overlay = $da->overlay_cloak($data, %opts);
Shorthand to the constructor for "Data::Annotation::Overlay", passing
$data as the under option and then the rest of %opts:
BUGS AND LIMITATIONS
Minimul perl version 5.24.
Report bugs through Codeberg (patches welcome) at
https://codeberg.org/polettix/Data-Annotation.
AUTHOR
Flavio Poletti <flavio@polettix.it>
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
( run in 1.805 second using v1.01-cache-2.11-cpan-39bf76dae61 )