Module: OneApiSdk::Client::Movies

Included in:
OneApiSdk::Client
Defined in:
lib/one_api_sdk/movies.rb

Instance Method Summary collapse

Instance Method Details

#movie(id, query_params = "") ⇒ Hash

Request one specific movie

Parameters:

  • id (String)

    the unique id of the movie

  • query_params (String) (defaults to: "")

    the query parameters you want to include in your search IE: “?sort=name:asc”

Returns:

  • (Hash)

    The returned movie object



23
24
25
26
# File 'lib/one_api_sdk/movies.rb', line 23

def movie(id,query_params="")
  response = call_with_token("#{Constants::MOVIE_BASE_PATH}/#{id}#{query_params}")
  JSON.parse(response.body)
end

#movie_quotes(id, query_params = "") ⇒ Hash

Request all movie quotes for one specific movie (only working for the LotR trilogy)

Parameters:

  • id (String)

    the unique id of the movie

  • query_params (String) (defaults to: "")

    the query parameters you want to include in your search IE: “?limit=50”

Returns:

  • (Hash)

    The returned movie quotes object



33
34
35
36
# File 'lib/one_api_sdk/movies.rb', line 33

def movie_quotes(id,query_params="")
  response = call_with_token("#{Constants::MOVIE_BASE_PATH}/#{id}/quote#{query_params}")
  JSON.parse(response.body)
end

#movies(query_params = "") ⇒ Array<Hash>

List of all “The Lord of the Rings” movies, including the “The Lord of the Rings” and the “The Hobbit” movies.

Parameters:

  • query_params (String) (defaults to: "")

    the query parameters you want to include in your search IE: “?sort=name:asc”

Returns:

  • (Array<Hash>)

    An array of movies



13
14
15
16
# File 'lib/one_api_sdk/movies.rb', line 13

def movies(query_params="")
  response = call_with_token("#{Constants::MOVIE_BASE_PATH}#{query_params}")
  JSON.parse(response.body)
end