Data::Context::Instance - The in memory instance of a data context config file
This documentation refers to Data::Context::Instance version 0.1.9.
use Data::Context::Instance; # create a new object my $dci = Data::Context::Instance->new( path => 'dir/file', file => Path::Tiny::path('path/to/dir/file.dc.js'), type => 'js', dc => $dc, ); # Initialise the object (done by get normally) $dci->init; # get the data (with the context of $vars) my $data = $dci->get_data($vars);
init()
Initialises the instance ie it reads the config file and merges in the parent if found
changed ()
Returns true if any of the files that go into this instance have changed (or if they haven't yet been processed) and returns false if this instance is still valid.
get_data ( $vars )
Returns the data from the config file processed with the context of $vars
process_data( $count, $data, $path )
This does the magic of processing the data, and in the future handling of the data event loop.
There are no known bugs in this module.
Please report problems to Ivan Wills (ivan.wills@gmail.com).
Patches are welcome.
Ivan Wills - (ivan.wills@gmail.com)
Copyright (c) 2012 Ivan Wills (14 Mullion Close, Hornsby Heights, NSW Australia 2077). All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
To install Data::Context, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Context
CPAN shell
perl -MCPAN -e shell install Data::Context
For more information on module installation, please visit the detailed CPAN module installation guide.