Andreas 'ac0v' Specht > Hyper > Hyper::Config::Object::Context

Download:
Hyper-v0.05.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  2
Open  1
View/Report Bugs
Module Version: v0.01   Source  

NAME ^

Hyper::Config::Object::Context - Context Configuration Object

VERSION ^

This document describes Hyper::Config::Object::Context 0.01

SYNOPSIS ^

    use Hyper::Config::Object::Context;
    use Hyper::Config::Object::Default;

    my $context = Hyper::Config::Object::Context->new();
    $context->set_config_of(
        'MyClass::Name' => Hyper::Config::Object::Default->new({
            data => {
                file => '/tmp/x.tmp',
                path => '/tmp',
            },
        }),
    );

       $context->get_config('MyClass::Name')->get_path()
    eq $context->get_config('MyClass::Singleton::Name')->get_path()
    eq '/tmp';

DESCRIPTION ^

Hyper::Config::Object::Context is used to access contextual configuration items, eg. cache_path for Hyper::Persistence.

SUBROUTINES/METHODS ^

set_config_of

    $context->set_config_of(
        'MyPackage::Name' => $config,
    );

You can set the config for a package where every kind of storable object and data structre is allowed as $config.

get_config

    my $config = $context->get_config('MyPackage::Name');

or use automatically the caller package as key

    my $config = $context->get_config();

Returns the Configuration item of an object.

Lookup Sequence (first found config is used)

DIAGNOSTICS ^

CONFIGURATION AND ENVIRONMENT ^

DEPENDENCIES ^

INCOMPATIBILITIES ^

BUGS AND LIMITATIONS ^

RCS INFORMATIONS ^

Last changed by
 $Author: ac0v $
Id
 $Id: Context.pm 317 2008-02-16 01:52:33Z ac0v $
Revision
 $Revision: 317 $
Date
 $Date: 2008-02-16 02:52:33 +0100 (Sa, 16 Feb 2008) $
HeadURL
 $HeadURL: http://svn.hyper-framework.org/Hyper/Hyper/tags/0.05/lib/Hyper/Config/Object/Context.pm $

AUTHOR ^

Andreas Specht <ACID@cpan.org>

LICENSE AND COPYRIGHT ^

Copyright (c) 2007, Andreas Specht <ACID@cpan.org>. All rights reserved.

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

syntax highlighting: