Class: Traktr::Shows

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/traktr/shows.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Shows

Returns a new instance of Shows.



6
7
8
# File 'lib/traktr/shows.rb', line 6

def initialize(client)
  @client = client
end

Instance Method Details

movies GET methods

Raises:

  • (ResponseError)


13
14
15
16
17
18
19
20
# File 'lib/traktr/shows.rb', line 13

def trending
  response = self.class.get('/' + File.join('trending.json', @client.api_key))
  raise ResponseError.new(response) if response.code != 200

  response.parsed_response.collect do |show|
    Mash.new(show)
  end
end

#updated(timestamp) ⇒ Object

Raises:

  • (ResponseError)


22
23
24
25
26
27
# File 'lib/traktr/shows.rb', line 22

def updated(timestamp)
  response = self.class.get('/' + File.join('updated.json', @client.api_key, timestamp.to_i.to_s))
  raise ResponseError.new(response) if response.code != 200

  Mash.new(response.parsed_response)
end