Class: TomatoPower::Client
- Inherits:
-
Object
- Object
- TomatoPower::Client
- Extended by:
- Forwardable
- Defined in:
- lib/tomato_power/client.rb
Instance Method Summary collapse
-
#initialize ⇒ Client
constructor
A new instance of Client.
-
#search_by_id(movie_id) ⇒ Object
Searches for a movie by IMDB id.
-
#search_by_title(movie_title, options = {}) ⇒ Object
Searches for a movie by title.
Constructor Details
#initialize ⇒ Client
Returns a new instance of Client.
11 12 13 |
# File 'lib/tomato_power/client.rb', line 11 def initialize @api = TomatoPower::api end |
Instance Method Details
#search_by_id(movie_id) ⇒ Object
Note:
As of Rotten Tomatoes API v1.0,they only support ID look up via IMDB ids.
Searches for a movie by IMDB id.
38 39 40 41 42 43 |
# File 'lib/tomato_power/client.rb', line 38 def search_by_id(movie_id) = {} [:type] = 'imdb' [:id] = movie_id @api.movie_alias() end |
#search_by_title(movie_title, options = {}) ⇒ Object
Note:
See / Rotten Tomatoes API for possible options.
Searches for a movie by title.
30 31 32 33 |
# File 'lib/tomato_power/client.rb', line 30 def search_by_title(movie_title, ={}) [:q] = movie_title @api.movies_search() end |