ModelSEED Configuration - ModelSEED/Model-SEED-core GitHub Wiki
Simple interface to store configuration info
This module provides a simple interface to get and store configuration information for the ModelSEED environment. This information is backed by a JSON file whose location is defined at object construction.
This initializes a configuration object. The method accepts an optional filename inside a hashref:
my $Config = ModelSEED::Configuration->new({filename => 'path/to/file.json'});
If no filename is supplied, the enviornment variable MODELSEED_CONFIG
is checked. If this variable is defined and is a valid path, it is used. Otherwise the default is to store configuration at .modelseed
in the current user's $HOME
directory. Note that you should probably use the instance
method instead.
Returns an instance of the MODELSEED_CONFIG
object.
Returns a hashref of configuration information. From the perspective of ModelSEED::Configuration, this hashref is unstructured, and may contain keys pointing to strings, arrays or other hashrefs.
my $item = $Config->config->{key};
Saves the data to the JSON file. Note that this happens on object destruction, so it's not absolutely neccesary.
$Config->save();