Class: FanartApi::Tv

Inherits:
Base
  • Object
show all
Defined in:
lib/fanart_api/tv.rb

Overview

documentation: fanart.tv/api-docs/tv-api

Instance Method Summary collapse

Methods inherited from Base

#get, #initialize, #params, #prepare_uri, #response, #restful_param_keys, #shared_uri, #uri

Constructor Details

This class inherits a constructor from FanartApi::Base

Instance Method Details

#find(id, type = 'all', sort = '1', limit = '2') ⇒ Object



3
4
5
# File 'lib/fanart_api/tv.rb', line 3

def find(id, type = 'all', sort = '1', limit = '2')
  get("series/#{shared_uri}").params(id: id, type: type, sort: sort, limit: limit).response
end

#update(timestamp = (Time.now - 172800).to_i) ⇒ Object



7
8
9
# File 'lib/fanart_api/tv.rb', line 7

def update(timestamp = (Time.now - 172800).to_i)
  get('newtv/{api_key}/{timestamp}').params(timestamp: timestamp).response
end