Module: Traktr::User::Library::Shows
- Includes:
- HTTParty
- Defined in:
- lib/traktr/user/library/shows.rb
Class Method Summary collapse
- .all(username = Traktr.username, extended = :min) ⇒ Object
- .collection(username = Traktr.username, extended = :min) ⇒ Object
- .watched(username = Traktr.username, extended = :min) ⇒ Object
Class Method Details
.all(username = Traktr.username, extended = :min) ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/traktr/user/library/shows.rb', line 8 def self.all(username = Traktr.username, extended = :min) response = self.get('/' + File.join('all.json', Traktr.api_key, username, extended.to_s)) raise ResponseError.new(response) if response.code != 200 response.parsed_response.collect do |item| Mash.new(item) end end |
.collection(username = Traktr.username, extended = :min) ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/traktr/user/library/shows.rb', line 17 def self.collection(username = Traktr.username, extended = :min) response = self.get('/' + File.join('collection.json', Traktr.api_key, username, 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, extended = :min) ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'lib/traktr/user/library/shows.rb', line 26 def self.watched(username = Traktr.username, extended = :min) response = self.get('/' + File.join('watched.json', Traktr.api_key, username, extended.to_s)) raise ResponseError.new(response) if response.code != 200 response.parsed_response.collect do |item| Mash.new(item) end end |