Class: Traktr::Show::Season
- Inherits:
-
Object
- Object
- Traktr::Show::Season
- Includes:
- HTTParty
- Defined in:
- lib/traktr/show/season.rb
Instance Method Summary collapse
-
#initialize(client) ⇒ Season
constructor
A new instance of Season.
-
#library(show, season) ⇒ Object
show-season POST methods.
- #seen(show, season) ⇒ Object
Constructor Details
#initialize(client) ⇒ Season
Returns a new instance of Season.
7 8 9 |
# File 'lib/traktr/show/season.rb', line 7 def initialize(client) @client = client end |
Instance Method Details
#library(show, season) ⇒ Object
show-season POST methods
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/traktr/show/season.rb', line 14 def library(show, season) data = { username: @client.username, password: @client.password, title: show.title, year: show.year, imdb_id: show.imdb_id, tvdb_id: show.tvdb_id, season: season } response = self.class.post("/" + File.join("library", @client.api_key), body: data.to_json, headers: { 'Content-Type' => 'application/json'}) raise ResponseError.new(response) if response.code != 200 Mash.new(response.parsed_response) end |
#seen(show, season) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/traktr/show/season.rb', line 26 def seen(show, season) data = { username: @client.username, password: @client.password, title: show.title, year: show.year, imdb_id: show.imdb_id, tvdb_id: show.tvdb_id, season: season } response = self.class.post("/" + File.join("seen", @client.api_key), body: data.to_json, headers: { 'Content-Type' => 'application/json'}) raise ResponseError.new(response) if response.code != 200 Mash.new(response.parsed_response) end |