Gnuplot::Builder::PrototypedData - generic prototype-based object
This is an internal module for Gnuplot::Builder distribution. End-users should not rely on this module.
Gnuplot::Builder::PrototypedData is a generic data structure depicted below.
PrototypedData | +--PartiallyKeyedList--+--entry | +--entry | +--... | +--attributes--{ key => value ... } | +--parent
It contains a Gnuplot::Builder::PartiallyKeyedList and a hash. The hash is called "attributes" here.
It supports prototype-based inheritance for both PartiallyKeyedList and attributes.
Entries and attribute values can be code-ref. If an "evaluator" is provided for the entries or attributes, the code-ref is automatically evaluated when you try to get the value. If there is no evaluator for the entry or attribute, it just returns the code-ref.
In %args:
%args
entry_evaluator
The evaluator for PKL entries. It is called like:
@result = $evaluator->($key, $value_code_ref)
For non-keyed entries, $key is undef.
$key
undef
attribute_evaluator
The key-evaluator pairs for attributes.
{ $attribute_name => $evaluator } ($result) = $evaluator->($attribute_name, $value_code_ref)
Set PKL entry. In %args,
entries
Array-ref of entry settings. If it contains a single string, the string is parsed. Otherwise it must be a flat array of key-value pairs.
key_prefix
Prefix prepended to the keys.
quote
If true, the values are quoted.
Get the values from the PKL. It resolves inheritance and evaluates code-ref values. If there is no such key in $pdata or any of its ancestors, it returns an empty list.
$pdata
In scalar context, get_resolved_entry() returns the first value for $key. If it would return an empty list in list context, it returns undef in scalar context.
get_resolved_entry()
Iterate over resolved PKL entries.
$code->($key, $resolved_values_array_ref)
Set an attribute value. Fields in %args are
key
value
Get the attribute value for the $name. It resolves inheritance and evaluates code-ref values if the corresponding evaluator exists. It returns undef if it cannot find the name anywhere.
$name
Toshio Ito, <toshioito at cpan.org>
<toshioito at cpan.org>
To install Gnuplot::Builder, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Gnuplot::Builder
CPAN shell
perl -MCPAN -e shell install Gnuplot::Builder
For more information on module installation, please visit the detailed CPAN module installation guide.