Class: ThetvdbApi::Response::Update

Inherits:
ThetvdbApi::Response show all
Defined in:
lib/thetvdb_api/response/update.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



24
25
26
# File 'lib/thetvdb_api/response/update.rb', line 24

def banner_normalize
  normalize('Banner')
end

#episode_normalizeObject



20
21
22
# File 'lib/thetvdb_api/response/update.rb', line 20

def episode_normalize
  normalize('Episode')
end

#normalize(key) ⇒ Object



28
29
30
# File 'lib/thetvdb_api/response/update.rb', line 28

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

#parseObject



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

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

#series_normalizeObject



16
17
18
# File 'lib/thetvdb_api/response/update.rb', line 16

def series_normalize
  normalize('Series')
end

#xml_parseObject



12
13
14
# File 'lib/thetvdb_api/response/update.rb', line 12

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