Module: Traktr::User

Includes:
HTTParty
Defined in:
lib/traktr/user.rb,
lib/traktr/user/library.rb,
lib/traktr/user/network.rb,
lib/traktr/user/ratings.rb,
lib/traktr/user/calendar.rb,
lib/traktr/user/progress.rb,
lib/traktr/user/watchlist.rb,
lib/traktr/user/library/shows.rb,
lib/traktr/user/library/movies.rb

Defined Under Namespace

Modules: Calendar, Library, Network, Progress, Ratings, Watchlist

Class Method Summary collapse

Class Method Details

.lastactivity(user = Traktr.username) ⇒ Object

Raises:

  • (ResponseError)


6
7
8
9
10
11
# File 'lib/traktr/user.rb', line 6

def self.lastactivity(user = Traktr.username)
  response = self.get("/" + File.join("lastactivity.json", Traktr.api_key, user))
  raise ResponseError.new(response) if response.code != 200

  Mash.new(response.parsed_response)
end

.list(slug, user = Traktr.username) ⇒ Object

Raises:

  • (ResponseError)


13
14
15
16
17
18
# File 'lib/traktr/user.rb', line 13

def self.list(slug, user = Traktr.username)
  response = self.get("/" + File.join("list.json", Traktr.api_key, user, slug))
  raise ResponseError.new(response) if response.code != 200

  Mash.new(response.parsed_response)
end

.lists(user = Traktr.username) ⇒ Object

Raises:

  • (ResponseError)


20
21
22
23
24
25
26
27
# File 'lib/traktr/user.rb', line 20

def self.lists(user = Traktr.username)
  response = self.get("/" + File.join("lists.json", Traktr.api_key, user))
  raise ResponseError.new(response) if response.code != 200

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

.profile(user = Traktr.username) ⇒ Object

Raises:

  • (ResponseError)


29
30
31
32
33
34
# File 'lib/traktr/user.rb', line 29

def self.profile(user = Traktr.username)
  response = self.get("/" + File.join("profile.json", Traktr.api_key, user))
  raise ResponseError.new(response) if response.code != 200

  Mash.new(response.parsed_response)
end

.watching(user = Traktr.username) ⇒ Object

Raises:

  • (ResponseError)


36
37
38
39
40
41
42
43
# File 'lib/traktr/user.rb', line 36

def self.watching(user = Traktr.username)
  response = self.get("/" + File.join("watching.json", Traktr.api_key, user))
  raise ResponseError.new(response) if response.code != 200

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