Andy Wardley > Badger-0.03 > Badger::Class::Default

Download:
Badger-0.03.tar.gz

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Source  

NAME ^

Badger::Class::Default - class mixin for creating parameter defaults

SYNOPSIS ^

    package My::Module;
    
    use Badger::Class
        base => 'Badger::Base';
    
    use Badger::Class::Defaults
        username => 'testuser',
        password => 'testpass';
        
    sub init {
        my ($self, $config) = @_;
        $self->init_defaults($config);
        return $self;
    }

DESCRIPTION ^

This class mixin module allows you to define default values for configuration parameters.

It is still experimental and subject to change.

METHODS ^

init_defaults($config)

This method is mixed into classes that use it. It creates a composite hash of all $DEFAULTS defined in package variables and updates the $self object using values provided explicitly in the $config hash, or falling back on the $DEFAULTS

See Badger::Class for further details.

AUTHOR ^

Andy Wardley http://wardley.org/

COPYRIGHT ^

Copyright (C) 2008 Andy Wardley. 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: