Module: Traktr::User::Watchlist
- Includes:
- HTTParty
- Defined in:
- lib/traktr/user/watchlist.rb
Class Method Summary collapse
- .episodes(username = Traktr.username) ⇒ Object
- .movies(username = Traktr.username) ⇒ Object
- .shows(username = Traktr.username) ⇒ Object
Class Method Details
.episodes(username = Traktr.username) ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/traktr/user/watchlist.rb', line 7 def self.episodes(username = Traktr.username) response = self.get('/' + File.join('episodes.json', Traktr.api_key, username)) raise ResponseError.new(response) if response.code != 200 response.parsed_response.collect do |item| Mash.new(item) end end |
.movies(username = Traktr.username) ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/traktr/user/watchlist.rb', line 16 def self.movies(username = Traktr.username) response = self.get('/' + File.join('movies.json', Traktr.api_key, username)) raise ResponseError.new(response) if response.code != 200 response.parsed_response.collect do |item| Mash.new(item) end end |
.shows(username = Traktr.username) ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/traktr/user/watchlist.rb', line 25 def self.shows(username = Traktr.username) response = self.get('/' + File.join('shows.json', Traktr.api_key, username)) raise ResponseError.new(response) if response.code != 200 response.parsed_response.collect do |item| Mash.new(item) end end |