Class: ThetvdbMapper::FullSeries

Inherits:
Base
  • Object
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

Constructor Details

This class inherits a constructor from ThetvdbMapper::Base

Instance Method Details

#actorsObject



18
19
20
# File 'lib/thetvdb_mapper/full_series.rb', line 18

def actors
  fetcher.actors(id).body.map { |actor| map_actor(actor) }
end

#bannersObject



26
27
28
# File 'lib/thetvdb_mapper/full_series.rb', line 26

def banners
  fetcher.banners(id).body.map { |banner| map_banner(banner) }
end

#dataObject



2
3
4
# File 'lib/thetvdb_mapper/full_series.rb', line 2

def data
  @data ||= series.merge(episodes: episodes, actors: actors, banners: banners)
end

#episodesObject



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

#inspectObject



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

#seriesObject



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