Module: Traktr::User::Progress

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

Instance Method Summary collapse

Instance Method Details

#collected(username = @client.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 collected(username = @client.username, title = :all, sort = :title, extended = :min)
  response = self.class.get('/' + File.join('collected.json', @client.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 = @client.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 watched(username = @client.username, title = :all, sort = :title, extended = :min)
  response = self.class.get('/' + File.join('watched.json', @client.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