Brad Choate > Net-Defensio-0.02 > Net::Defensio::Response

Download:
Net-Defensio-0.02.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.01   Source  

NAME ^

Net::Defensio::Response - Object for holding response to a Net::Defensio request.

SYNOPSIS ^

    my $r = $defensio->audit_comment( ..... )
        or die $defensio->errstr;
    if ($r->success) {
        print "Spaminess: " . $r->spaminess . "\n";
    } else {
        print "Failure: " . $r->message . "\n";
    }

METHODS ^

Net::Defensio::Response->new( \%data )

Constructs a new Net::Defensio::Response object, initializing it with the parameter data given.

$response->success

Returns a true value when the 'status' member is set to 'true'. Returns false otherwise.

$response->is_spam

Returns a true value when the 'spam' member is set to 'true'. Only useful for responses to 'audit-comment' requests.

$response->is_ham

Returns a true value when the 'spam' member is set to 'false'. Only useful for responses to 'audit-comment' requests.

$response->action

Holds the name of the 'action' for the Defensio API request. Set for all response objects.

$response->status

Holds the status member of a Defensio API response. Will be set to either 'success' or 'fail'. Set for all response objects.

$response->message

Holds the message member of a Defensio API response. Set for all response objects, but may be an empty string.

$response->api_version

Holds the api-version member of a Defensio API response. Set for all response objects.

$response->spam

For 'audit-comment' requests, this contains a boolean value, represented as 'true' or 'false'.

For 'get-stats' requests, this contains an integer of the number of messages Defensio has rated as spam.

$response->spaminess

For 'audit-comment' requests. Holds the floating-point value of the "spaminess" of the comment.

$response->signature

For 'audit-comment' requests. Holds the signature member of the Defensio response.

$response->ham

For 'get-stats' requests, this contains an integer of the number of messages Defensio has rated as ham (legitimate comments).

$response->false_positives

For 'get-stats' requests, this contains an integer of the number of messages that have been submitted to Defensio for retraining as spam.

$response->false_negatives

For 'get-stats' requests, this contains an integer of the number of messages that have been submitted to Defensio for retraining as non-spam.

$response->accuracy

For 'get-stats' requests, this contains a floating-point number representing the accuracy of the Defensio filters (from 0 to 1; 0 being 100% inaccurate, 1 being 100% accurate).

$response->learning

For 'get-stats' requests, this contains a boolean value indicating whether the Defensio filter is still in 'learning mode' for the account being used (either set to 'true' or 'false').

$response->learning_message

For 'get-stats' requests, this contains a message explaining why the Defensio filter is still in 'learning mode'. Only relevant when 'learning' is returned as 'true'.

COPYRIGHT & LICENSE ^

Copyright 2007 Brad Choate, all rights reserved.

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

syntax highlighting: