Data::Context

Configuration data with context
Download

Data::Context Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Ivan Wills
  • Publisher web site:

Data::Context Tags


Data::Context Description

Get object Build -> parse file -> if "PARENT" build parent -> merge self and raw parent -> construct instance -> iterate to all values -> if the value is a string of the form "#...#" make sub reference to add to call list -> if the value is a HASHREF & "MODULE" or "METHOD" keys exist add to call list -> cache resultUse object -> clone raw data -> call each method call list -> if return is a CODEREF assume it's an event handler -> else replace data with returned value -> if any event handlers are returned run event loop -> return dataMODULE HASHES { "MODULE" : "My::Module", "METHOD" : "get_data", "NEW" : "new", ... } or { "METHOD" : "do_something", "ORDER" : 1, .... }1st : calls My::Module->new->get_data (if NEW wasn't present would just call My::Module->get_data) 2nd : calls Data::Context::Actions->do_somethingthe parameters passed in both cases are $value = the hashref containing the method call $dc = The whole data context raw data $path = A path of how to get to this data $vars = The variables that the get was called withData::Context is a Perl module that provides configuration path string or list of strings containing directory names to be searched config files fallback bool if true if a config isn't found the parent config will be searched for etc fallback_depth If set to a non zero value the fall back will limited to this number of times actions hashref of coderefs, allows simple adding of extra methods to Data::Context::Actions action_class Allows the using of an action class other than Data::Context::Actions. Although it is suggested that the alt class should inherit from Data::Context::Actions file_suffixes HASHREF json => '.dc.json' : JSON js => '.dc.js' : JSON->relaxed yaml => '.dc.yml' : YAML or YAML::XS xml => '.dc.xml' : XML::Simple log logging object, creates own object that just writes to STDERR if not specified debug set the debugging level default is WARN (DEBUG, INFO, WARN, ERROR or FATAL) cache ...SYNOPSIS use Data::Context; # create a new Data::Context variable my $dc = Data::Context->new( path => , ); # read a config my $data = $dc->get( 'some/config', { context => 'values', } );Product's homepage


Data::Context Related Software