NAME

CHI::Config::Driver - Container for Driver configuration

VERSION

version 0.001000

SYNOPSIS

my $config = CHI::Config::Driver->new(
  name     => 'my.name.here',
  file     => '/path/config_was_loaded_from',    # for debugging
  entry_no => 5,                                 # entry number in 5 for debugging
  config   => {},                                # CHI Payload
  memoize  => 0 || 1,                            # whether multiple calls make singular objects
);

This is mostly an implementation detail for CHI::Config.

Each instance directly maps to an entry in the configuration file.

Two parameters file and entry_no are provided automatically by the infrastructure.

METHODS

get_cache

Returns a CHI cache object using the definition in config.

This may return the same object across multiple calls ( if "memoize" is true ).

Otherwise returns a new CHI instance with every call.

source

Returns a string

ATTRIBUTES

name

The name of this driver for look-up purposes.

Strongly Recommended format ( especially for CPAN ) is some sort of alias path with a prefix, i.e:

name => 'dist-zilla-cache.www-objects'

config

This is a raw hash payload that gets passed to CHI->new().

config => {
  driver => 'Memory',
  ...                   # For example
}

memoize

This attribute dictates whether multiple calls to get_cache will return different cache objects ( which may happen to share implementation details ), or whether it will return a single cache object for multiple calls.

memoize => 0  # Default, each call to get_cache returns a new CHI instance
memoize => 1  # Construct CHI cache once and return it multiple times.

file

Pertains to the location this Driver configuration was determined from.

This is an implementation detail used for debug purposes in CHI::Config and is normally provided by the various configuration sourcing tools.

entry_no

Pertains to the placement in the array of configuration details ( in file ) where the configuration for this Driver was found.

This is an implementation detail used for debug purposes in CHI::Config and is normally provided by the various configuration sourcing tools.

AUTHOR

Kent Fredric <kentnl@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2014 by Kent Fredric <kentfredric@gmail.com>.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.