Class: Traktr::Search

Inherits:
Endpoint show all
Defined in:
lib/traktr/search.rb

Instance Method Summary collapse

Methods inherited from Endpoint

#initialize

Constructor Details

This class inherits a constructor from Traktr::Endpoint

Instance Method Details

#episodes(query, limit = 30) ⇒ Object



3
4
5
# File 'lib/traktr/search.rb', line 3

def episodes(query, limit = 30)
  parse_response self.class.get('/' + File.join('episodes.json', @client.api_key, URI::encode(query), limit.to_s))
end

#movies(query, limit = 30) ⇒ Object



7
8
9
# File 'lib/traktr/search.rb', line 7

def movies(query, limit = 30)
  parse_response self.class.get('/' + File.join('movies.json', @client.api_key, URI::encode(query), limit.to_s))
end

#people(query, limit = 30) ⇒ Object



11
12
13
# File 'lib/traktr/search.rb', line 11

def people(query, limit = 30)
  parse_response self.class.get('/' + File.join('people.json', @client.api_key, URI::encode(query), limit.to_s))
end

#shows(query, limit = 30, seasons = nil) ⇒ Object



15
16
17
18
# File 'lib/traktr/search.rb', line 15

def shows(query, limit = 30, seasons = nil)
  seasons = seasons == nil || seasons == false ? "" : "seasons"
  parse_response self.class.get('/' + File.join('shows.json', @client.api_key, URI::encode(query), limit.to_s, seasons))
end

#users(query, limit = 30) ⇒ Object



20
21
22
# File 'lib/traktr/search.rb', line 20

def users(query, limit = 30)
  parse_response self.class.get('/' + File.join('users.json', @client.api_key, URI::encode(query), limit.to_s), :basic_auth => @auth)
end