module TmdbRexx::Client::Search
Constants
- POSSIBLE_TYPES
- RESOURCE
Public Instance Methods
search(type, query, options = {})
click to toggle source
Search
the tmdb database for the specified type
@see docs.themoviedb.apiary.io/#reference/search @see docs.themoviedb.apiary.io/#reference/search/searchcompany @see docs.themoviedb.apiary.io/#reference/search/searchcollection @see docs.themoviedb.apiary.io/#reference/search/searchkeyword @see docs.themoviedb.apiary.io/#reference/search/searchlist @see docs.themoviedb.apiary.io/#reference/search/searchmovie @see docs.themoviedb.apiary.io/#reference/search/searchmulti @see docs.themoviedb.apiary.io/#reference/search/searchperson @see docs.themoviedb.apiary.io/#reference/search/searchtv
@param [String] type the type of resource to search.
Possible types include: * company - Search for companies by name. * collection - Search for collections by name. * keyword - Search for keywords by name. * list - Search for lists by name and description. * movie - Search for movies by title. * multi - Search the movie, tv show and person collections with a single query. Each item returned in the result array has a media_type field that maps to either movie, tv or person.Each mapped result is the same response you would get from each independent search. * person - Search for people by name. * tv - Search for TV shows by title.
@return [Hashie::Mash] changes response
@example Get the movie search api response
TmdbRexx::Client.search("movie", "some-query")
# File lib/tmdb_rexx/client/search.rb, line 34 def search(type, query, options = {}) raise InvalidTypeError unless POSSIBLE_TYPES.include?(type) options.merge!(query: query) get([RESOURCE, type].join("/"), options) end