The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

SeeAlso::Response - SeeAlso Simple Response

DESCRIPTION

This class models a SeeAlso Simple Response which is practically the same as am OpenSearch Suggestions Response.

METHODS

new ( [ $query [, $completions, $descriptions, $urls ] )

Creates a new SeeAlso::Response object (this is the same as an OpenSearch Suggestions Response object). If the passed query parameter is an instance of SeeAlso::Identifier, the return of its normalized method is used.

add ( $label [, $description [, $uri ] ] )

Add an item to the result set. All parameters must be strings.

size

Get the number of entries in this response.

hasQuery

Returns whether a non-empty query has been provided.

toJSON ( [ $callback ] )

Return the response in JSON format and a non-mandatory callback wrapped around. There is no test whether the callback name is valid so far. The encoding will not be changed, please only feed response objects with UTF-8 strings to get UTF-8 JSON with this method!