Module: Traktr::User::Watchlist

Includes:
HTTParty
Defined in:
lib/traktr/user/watchlist.rb

Instance Method Summary collapse

Instance Method Details

#episodes(username = @client.username) ⇒ Object

Raises:

  • (ResponseError)


7
8
9
10
11
12
13
14
# File 'lib/traktr/user/watchlist.rb', line 7

def episodes(username = @client.username)
  response = self.class.get('/' + File.join('episodes.json', @client.api_key, username))
  raise ResponseError.new(response) if response.code != 200

  response.parsed_response.collect do |item|
    Mash.new(item)
  end
end

#movies(username = @client.username) ⇒ Object

Raises:

  • (ResponseError)


16
17
18
19
20
21
22
23
# File 'lib/traktr/user/watchlist.rb', line 16

def movies(username = @client.username)
  response = self.class.get('/' + File.join('movies.json', @client.api_key, username))
  raise ResponseError.new(response) if response.code != 200

  response.parsed_response.collect do |item|
    Mash.new(item)
  end
end

#shows(username = @client.username) ⇒ Object

Raises:

  • (ResponseError)


25
26
27
28
29
30
31
32
# File 'lib/traktr/user/watchlist.rb', line 25

def shows(username = @client.username)
  response = self.class.get('/' + File.join('shows.json', @client.api_key, username))
  raise ResponseError.new(response) if response.code != 200

  response.parsed_response.collect do |item|
    Mash.new(item)
  end
end