Gapp::Form::Context::Node - Context node object
$o = Foo::Character->new( fname => 'Mickey', lname => 'Mouse' ); $cx = Gapp::Form::Context->new; $node = $cx->add( 'character', $o ); $node->lookup( 'fname' ); # returns 'Mickey' $node->modify( 'fname', 'Minnie' );
A context node contains a reference to a data structure and rules for accessing and modifying that data. The context is used to sync data between objects/data structures and forms.
The accessor is used to update and retrieve data from the data sctructure. If no accessor is set, reader and writer methods will be used.
The data structure to operate on. If set to a <CodeRef>, the CodeRef will be executed at lookup/modification time and the return value will be used as the data structure.
CodeRef
When doing a lookup, the reader_prefix is appended to beginning of the attribute name to form the reader method. This method will then be called on the data structure to retrieve the value. If an accessor has been defined, that will be used instead.
lookup
reader_prefix
accessor
When doing a modify, the writer_prefix is appended to beginning of the attribute name to form the writer method. This method will then be called on the data structure to store the value. If an accessor has been defined, that will be used instead.
modify
writer_prefix
Retrieves a value from the context. $path is a string in the format of "node_name.attribute".
$path
Sets a value in the context. $path is a string in the format of "nodename.attribute".
Jeffrey Ray Hallock <jeffrey.hallock at gmail dot com>
Copyright (c) 2011-2012 Jeffrey Ray Hallock. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Gapp, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Gapp
CPAN shell
perl -MCPAN -e shell install Gapp
For more information on module installation, please visit the detailed CPAN module installation guide.