The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

WebService::Nestoria::Search::Response - Container object for the result set of a query to the Nestoria Search API.

This package is used by WebService::Nestoria::Search and a WebService::Nestoria::Search::Response object should never need to be explicitly created by the user.

Functions

get_raw

Returns the raw data returned by the Nestoria API. By default this will be JSON (JavaScript Object Notation.) get_json and get_xml are aliases to get_raw.

Functions other than get_raw only work if encoding was set to 'json'. If encoding is set to anything else ('xml' for example) then results will return an empty array, get_hashref a reference to an empty hash, etc.

status_code

Returns the status code of the response. 200 on success, various other numbers on errors.

get_hashref

Returns a reference to a hash that contains exactly what the response from the Nestoria API gave, converted from JSON into a hashref with JSON::jsonToObj()

count

Returns the number of listings found.

attribution

Returns a reference to a hash that contains the 'attribution' data returend by the server. Allows users to link back to Nestoria.

attribution_html

Returns the attribution formatted in HTML for ease of use on websites.

attribution_xhtml

Returns the attribution formatted in XHTML for ease of use on websites.

results

Returns an array of WebService::Nestoria::Search::Result objects, each containing data about a single listing returned by the Nestoria API.

next_result

Returns the next WebService::Nestoria::Search::Result object to be fetched. When out of listings returns undef, making it suitable for use in while loops.

    while ( $listing = $result->next_result ) {
        # do something;
    }

reset

Resets the counter used for next_result.

Copyright

Copyright (C) 2008 Lokku Ltd.

Author

Alex Balhatchet (kaoru@slackwise.net) Yoav Felberbaum (perl@mrdini.com)