Class: ThetvdbApi::Request::Update
- Inherits:
-
Base
- Object
- Base
- ThetvdbApi::Request::Update
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
.all ⇒ Object
14
15
16
|
# File 'lib/thetvdb_api/request/update.rb', line 14
def self.all
new(:all)
end
|
.day ⇒ Object
2
3
4
|
# File 'lib/thetvdb_api/request/update.rb', line 2
def self.day
new(:day)
end
|
.month ⇒ Object
10
11
12
|
# File 'lib/thetvdb_api/request/update.rb', line 10
def self.month
new(:month)
end
|
.week ⇒ Object
6
7
8
|
# File 'lib/thetvdb_api/request/update.rb', line 6
def self.week
new(:week)
end
|
Instance Method Details
#banners_response ⇒ Object
34
35
36
|
# File 'lib/thetvdb_api/request/update.rb', line 34
def banners_response
collection_response('Banner', ThetvdbApi::Banner)
end
|
#episodes_response ⇒ Object
30
31
32
|
# File 'lib/thetvdb_api/request/update.rb', line 30
def episodes_response
collection_response('Episode', ThetvdbApi::Episode)
end
|
#result ⇒ Object
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_response ⇒ Object
26
27
28
|
# File 'lib/thetvdb_api/request/update.rb', line 26
def series_response
collection_response('Series', ThetvdbApi::Series)
end
|
#uri ⇒ Object
22
23
24
|
# File 'lib/thetvdb_api/request/update.rb', line 22
def uri
"#{ThetvdbApi::Configuration.api_key}/updates/updates_#{@period}.xml"
end
|