Class: OMDB::Client
Overview
Client for handling requests to the omdbapi.com API.
Instance Method Summary collapse
-
#find(title) ⇒ Array, Hash
Find a movie by its title.
-
#id(imdb_id) ⇒ Hash
Retrieves a movie or show based on its IMDb ID.
-
#title(title, year = nil) ⇒ Hash
Retrieves a movie or show based on its title.
Instance Method Details
#find(title) ⇒ Array, Hash
Find a movie by its title.
38 39 40 41 |
# File 'lib/omdbapi/client.rb', line 38 def find(title) results = get '/', { s: title } results[:search] ? results[:search] : results end |
#id(imdb_id) ⇒ Hash
Retrieves a movie or show based on its IMDb ID.
28 29 30 |
# File 'lib/omdbapi/client.rb', line 28 def id(imdb_id) return get '/', { i: imdb_id } end |
#title(title, year = nil) ⇒ Hash
Retrieves a movie or show based on its title.
17 18 19 |
# File 'lib/omdbapi/client.rb', line 17 def title(title, year=nil) get '/', { t: title } end |