Class: ThetvdbApi::Request::Update

Inherits:
Base
  • Object
show all
Defined in:
lib/thetvdb_api/request/update.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

api_key, #array_mapped, #array_normalize, #collection_response, #data, #dig, #object_response, #request_options, #response, #response_condition?

Constructor Details

#initialize(period) ⇒ Update

Returns a new instance of Update.



18
19
20
# File 'lib/thetvdb_api/request/update.rb', line 18

def initialize(period)
  @period = period
end

Class Method Details

.allObject



14
15
16
# File 'lib/thetvdb_api/request/update.rb', line 14

def self.all
  new(:all)
end

.dayObject



2
3
4
# File 'lib/thetvdb_api/request/update.rb', line 2

def self.day
  new(:day)
end

.monthObject



10
11
12
# File 'lib/thetvdb_api/request/update.rb', line 10

def self.month
  new(:month)
end

.weekObject



6
7
8
# File 'lib/thetvdb_api/request/update.rb', line 6

def self.week
  new(:week)
end

Instance Method Details

#banners_responseObject



34
35
36
# File 'lib/thetvdb_api/request/update.rb', line 34

def banners_response
  collection_response('Banner', ThetvdbApi::Banner)
end

#episodes_responseObject



30
31
32
# File 'lib/thetvdb_api/request/update.rb', line 30

def episodes_response
  collection_response('Episode', ThetvdbApi::Episode)
end

#resultObject



38
39
40
41
42
43
44
# File 'lib/thetvdb_api/request/update.rb', line 38

def result
  {
    series: series_response,
    episodes: episodes_response,
    banners: banners_response
  }
end

#series_responseObject



26
27
28
# File 'lib/thetvdb_api/request/update.rb', line 26

def series_response
  collection_response('Series', ThetvdbApi::Series)
end

#uriObject



22
23
24
# File 'lib/thetvdb_api/request/update.rb', line 22

def uri
  "#{ThetvdbApi::Configuration.api_key}/updates/updates_#{@period}.xml"
end