NAME

Data::Annotation::Chain

SYNOPSIS

use Data::Annotation::Chain;

DESCRIPTION

Representation of a chain, meant to be used by Data::Annotation.

INTERFACE

Constructor

new

my $chain = Data::Annotation::Chain->(%opts);

Make a new instance for a chain.

Input parameter rules is supposed to be an array reference whose content will be overwritte in time with Data::Annotation::Rule instances, unless elements are already blessed.

Accessors

default_retval

my $retval = $chain->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 = $chain->description;

An optional description for the chain definition. It will be useful for you in a couple of months, after you forgot everything about it.

parse_context

my $ctx = $chain->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.

rules

my $aref = $chain->rules;

Get the list of rules configured for the chain. Thi

Methods

evaluate

my $result = $chain->evaluate($state, $overlay);

Evaluate the annotation for data wrapped in some $overlay, leveraging state in $state.

ANYTHING ELSE (INCLUDING AUTHOR, COPYRIGHT AND LICENSE)

See documentation for Data::Annotation.