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

Download:
Badger-0.03.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Source  

NAME ^

Badger::Class::Aliases - class mixin for creating parameter aliases

SYNOPSIS ^

    package My::Module;
    
    use Badger::Class
        base => 'Badger::Base';
    
    use Badger::Class::Aliases
        user => 'username',
        pass => 'password';
        
    sub init {
        my ($self, $config) = @_;
        $self->init_aliases($config);
        $self->{ user } = $config->{ user };
        $self->{ pass } = $config->{ pass };
        return $self;
    }

DESCRIPTION ^

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

It is still experimental and subject to change.

METHODS ^

init_aliases($config)

This method is mixed into classes that use it. It creates a composite hash of all $ALIASES defined in package variables and updates the $config hash reference, adding entries against the definitive name for any options that are specified using aliases.

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: