Module: Vinegar::Client::Movie

Included in:
Vinegar::Client
Defined in:
lib/vinegar/client/movie.rb

Overview

Movies Search

Instance Method Summary collapse

Instance Method Details

#movie(movie_id, options = {}) ⇒ Hashie::Mash

Detailed information on a specific movie specified by Id. You can use the movies search endpoint or peruse the lists of movies/dvds to get the urls to movies.

Examples:

Get the results for a specific movie id

@client.movie(12345)

Parameters:

  • Movie (Integer)

    ID from Rotten Tomatoes

Returns:

  • (Hashie::Mash)

    Movie Response

See Also:

Author:

  • Jason Truluck



50
51
52
# File 'lib/vinegar/client/movie.rb', line 50

def movie(movie_id, options = {})
  get("movies/#{movie_id}.json", options)
end

#movies_search(query, per_page = "", page = "", options = {}) ⇒ Hashie::Mash

Returns the response from querying the movies search endpoint

Examples:

Get the search results for a query

@client.movies_search("Movie Title")

Get the search results for a query with a page limit

@client.movies_search("Movie Title", 10)

Get the search results for a query with a page limit and a page

@client.movies_search("Movie Title", 10, 1)

Parameters:

  • query (String)

    The query you want to search on

  • page_limit (Integer)

    The amount of movie search results to show per page

  • page (Integer) (defaults to: "")

    The selected page of movie search results

Returns:

  • (Hashie::Mash)

    Movies serach Response

See Also:

Author:

  • Jason Truluck



28
29
30
31
32
33
34
35
# File 'lib/vinegar/client/movie.rb', line 28

def movies_search(query, per_page = "", page = "", options = {})
  options.merge!(
    :q          => query,
    :page_limit => per_page,
    :page       => page
  )
  get("movies.json", options)
end