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

NAME

    Net::Async::Spotify::Util - Helper class for some common functions.

DESCRIPTION

Helper class that will have some functions that are general and can be used across library.

METHODS

response_object_map

Due to the unstructured response details in Spotify documentation page in regards they type of response for every request. This method will act as a reliable mapping for Spotify API responses to their desired Objects type. Takes:

available_types

which consists of the availabe Object types that are loaded by Caller.

response_hash

which consists of possible `response_objs` types and `uri` that was called for this response.

It uses smart matching mechanism; meaning that it will check @$expected passed by trying to find for the exact Object name, if not found it will get the first object that includes the passed name as part of it's own name. It will return the Object class name if found, and `undef` when it can't find a suitable object.

hash_to_string

Not so proper way to stringify a Hash. Used to make Hash printable and readable to human.