Module: Traktr::Search
- Includes:
- HTTParty
- Defined in:
- lib/traktr/search.rb
Class Method Summary collapse
-
.episodes(query) ⇒ Object
search GET methods.
- .movies(query) ⇒ Object
- .people(query) ⇒ Object
- .shows(query) ⇒ Object
- .users(query) ⇒ Object
Class Method Details
.episodes(query) ⇒ Object
search GET methods
9 10 11 12 13 14 15 16 |
# File 'lib/traktr/search.rb', line 9 def self.episodes(query) response = self.get('/' + File.join('episodes.json', Traktr.api_key, URI::encode(query))) raise ResponseError.new(response) if response.code != 200 response.parsed_response.collect do |result| Mash.new(result) end end |
.movies(query) ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/traktr/search.rb', line 18 def self.movies(query) response = self.get('/' + File.join('movies.json', Traktr.api_key, URI::encode(query))) raise ResponseError.new(response) if response.code != 200 response.parsed_response.collect do |result| Mash.new(result) end end |
.people(query) ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/traktr/search.rb', line 27 def self.people(query) response = self.get('/' + File.join('people.json', Traktr.api_key, URI::encode(query))) raise ResponseError.new(response) if response.code != 200 response.parsed_response.collect do |result| Mash.new(result) end end |
.shows(query) ⇒ Object
36 37 38 39 40 41 42 43 |
# File 'lib/traktr/search.rb', line 36 def self.shows(query) response = self.get('/' + File.join('shows.json', Traktr.api_key, URI::encode(query))) raise ResponseError.new(response) if response.code != 200 response.parsed_response.collect do |result| Mash.new(result) end end |
.users(query) ⇒ Object
45 46 47 48 49 50 51 52 |
# File 'lib/traktr/search.rb', line 45 def self.users(query) response = self.get('/' + File.join('users.json', Traktr.api_key, URI::encode(query))) raise ResponseError.new(response) if response.code != 200 response.parsed_response.collect do |result| Mash.new(result) end end |