Handel - A cart/order/checkout framework with AxKit/TT/Catalyst support


Handel documentation Contained in the Handel distribution.

Index


Code Index:

NAME

Top

Handel - A cart/order/checkout framework with AxKit/TT/Catalyst support

SYNOPSIS

Top

    use Handel;
    Handel->config_class('My::ConfigReader');

    my $config = Handel->config;
    # $config->isa('My::ConfigReader')

DESCRIPTION

Top

This is a generic class containing the default configuration used by other Handel classes.

To learn more about what Handel is and how it works, take a look at the manual (Handel::Manual).

METHODS

Top

config_class

Arguments: $config_class

Gets/sets the name of the configuration class to use. The default configuration class is Handel::ConfigReader.

A Handel::Exception exception will be thrown if the specified class can not be loaded.

config

Returns an instance of the specified configuration class.

SEE ALSO

Top

Handel::Cart, Handel::Order, Handel::Checkout

AUTHOR

Top

    Christopher H. Laco
    CPAN ID: CLACO
    claco@chrislaco.com
    http://today.icantfocus.com/blog/



Handel documentation Contained in the Handel distribution.

# $Id$
package Handel;
use strict;
use warnings;
use vars qw/$VERSION/;

$VERSION = '1.00013';

BEGIN {
    use base qw/Class::Accessor::Grouped/;
    use Handel::Exception qw/:try/;
    use Handel::L10N qw/translate/;
};

__PACKAGE__->config_class('Handel::ConfigReader');

sub config_class {
    my ($self, $config_class) = @_;

    if ($config_class) {
        eval "require $config_class"; ## no critic

        throw Handel::Exception(
            -details => translate('The config_class [_1] could not be loaded', $config_class)
        ) if $@; ## no critic

        $self->set_inherited('config_class', $config_class);
    };

    return $self->get_inherited('config_class');
};

sub config {
    return shift->config_class->instance;
};

1;
__END__