Class: Traktr::Shows
Instance Method Summary collapse
-
#initialize(client) ⇒ Shows
constructor
A new instance of Shows.
-
#trending ⇒ Object
movies GET methods.
- #updated(timestamp) ⇒ Object
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
#trending ⇒ Object
movies GET methods
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
22 23 24 25 26 27 |
# File 'lib/traktr/shows.rb', line 22 def updated() response = self.class.get('/' + File.join('updated.json', @client.api_key, .to_i.to_s)) raise ResponseError.new(response) if response.code != 200 Mash.new(response.parsed_response) end |