Module: Traktr::User::Progress

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

Class Method Summary collapse

Class Method Details

.collected(username = Traktr.username, title = :all, sort = :title, extended = :min) ⇒ Object

Raises:

  • (ResponseError)


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

def self.collected(username = Traktr.username, title = :all, sort = :title, extended = :min)
  response = self.get('/' + File.join('collected.json', Traktr.api_key, username, title.to_s, sort.to_s, extended.to_s))
  raise ResponseError.new(response) if response.code != 200

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

.watched(username = Traktr.username, title = :all, sort = :title, extended = :min) ⇒ Object

Raises:

  • (ResponseError)


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

def self.watched(username = Traktr.username, title = :all, sort = :title, extended = :min)
  response = self.get('/' + File.join('watched.json', Traktr.api_key, username, title.to_s, sort.to_s, extended.to_s))
  raise ResponseError.new(response) if response.code != 200

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