Purple - Distributed granular addresses on the web


Purple documentation Contained in the Purple distribution.

Index


Code Index:

NAME

Top

Purple - Distributed granular addresses on the web

VERSION

Top

Version 1.2

SYNOPSIS

Top

Factory class for generating purple numbers.

    use Purple;

    my $p = Purple->new;  # by default, uses SQLite backend
    ...

METHODS

Top

new(%options)

You can specify a different backend by passing:

  type => 'backend'

where 'backend' is the name of the backend. If you don't pass any parameters, uses SQLite by default.

AUTHOR

Top

Chris Dent, <cdent@burningchrome.com>

Eugene Eric Kim, <eekim@blueoxen.com>

BUGS

Top

Please report any bugs or feature requests to bug-purple@rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Purple. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

COPYRIGHT & LICENSE

Top


Purple documentation Contained in the Purple distribution.

package Purple;

use warnings;
use strict;

our $VERSION = '1.3';

my $DEFAULT_TYPE = 'SQLite';

# XXX these are not what they look like
# make this an explicit factory
sub new {
    my $class = shift;
    my %p = @_;

    $p{type} ||= $DEFAULT_TYPE;

    my $real_class = 'Purple::' . $p{type};
    unless ( $real_class->can('_New') ) {
        eval "require $real_class";
        die "Unable to load $real_class: $@" if $@;
    }

    # store is a directory
    return $real_class->_New(store => $p{store});
}

1; # End of Purple