Class: ThetvdbMapper::FullSeries
- Inherits:
-
Base
- Object
- Base
- ThetvdbMapper::FullSeries
show all
- Defined in:
- lib/thetvdb_mapper/full_series.rb
Instance Attribute Summary
Attributes inherited from Base
#id
Instance Method Summary
collapse
Methods inherited from Base
#fetcher, #initialize
Instance Method Details
#actors ⇒ Object
18
19
20
|
# File 'lib/thetvdb_mapper/full_series.rb', line 18
def actors
fetcher.actors(id).body.map { |actor| map_actor(actor) }
end
|
#banners ⇒ Object
26
27
28
|
# File 'lib/thetvdb_mapper/full_series.rb', line 26
def banners
fetcher.banners(id).body.map { |banner| map_banner(banner) }
end
|
#data ⇒ Object
2
3
4
|
# File 'lib/thetvdb_mapper/full_series.rb', line 2
def data
@data ||= series.merge(episodes: episodes, actors: actors, banners: banners)
end
|
#episodes ⇒ Object
10
11
12
|
# File 'lib/thetvdb_mapper/full_series.rb', line 10
def episodes
fetcher.full_series(id).body['Episode'].map { |episode| map_episode(episode) }
end
|
#inspect ⇒ Object
34
35
36
|
# File 'lib/thetvdb_mapper/full_series.rb', line 34
def inspect
"<ThetvdbMapper::FullSeries data=#{data.to_s} >"
end
|
#map_actor(data) ⇒ Object
22
23
24
|
# File 'lib/thetvdb_mapper/full_series.rb', line 22
def map_actor(data)
ThetvdbMapper::Mapping::Actor.map(data)
end
|
#map_banner(data) ⇒ Object
30
31
32
|
# File 'lib/thetvdb_mapper/full_series.rb', line 30
def map_banner(data)
ThetvdbMapper::Mapping::Banner.map(data)
end
|
#map_episode(data) ⇒ Object
14
15
16
|
# File 'lib/thetvdb_mapper/full_series.rb', line 14
def map_episode(data)
ThetvdbMapper::Mapping::Episode.map(data)
end
|
#series ⇒ Object
6
7
8
|
# File 'lib/thetvdb_mapper/full_series.rb', line 6
def series
ThetvdbMapper::Mapping::Series.map(fetcher.full_series(id).body['Series'])
end
|