Class: ThetvdbApi::Response::FullSeries

Inherits:
ThetvdbApi::Response show all
Defined in:
lib/thetvdb_api/response/full_series.rb

Instance Method Summary collapse

Methods inherited from ThetvdbApi::Response

#[], #[]=, #body, #each, #env, #headers, #initialize, #inspect, #multi_xml_parse, #status

Constructor Details

This class inherits a constructor from ThetvdbApi::Response

Instance Method Details

#episode_normalizeObject



14
15
16
# File 'lib/thetvdb_api/response/full_series.rb', line 14

def episode_normalize
  normalize('Episode')
end

#normalize(key) ⇒ Object



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

def normalize(key)
  @parse[key] = [@parse[key]] if @parse[key].is_a?(Hash)
end

#parseObject



2
3
4
5
6
7
8
# File 'lib/thetvdb_api/response/full_series.rb', line 2

def parse
  unless @parse
    @parse = xml_parse
    episode_normalize
  end
  @parse
end

#xml_parseObject



10
11
12
# File 'lib/thetvdb_api/response/full_series.rb', line 10

def xml_parse
  multi_xml_parse.fetch('Data', {})
end