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