Class: TvRage::Api::Show
Instance Attribute Summary
#xml_doc
Instance Method Summary
collapse
#==, #actors, #air_dates, #attributes, find, #initialize, #language, #name, #overview, #remote_ids, search_xml_document, search_xml_string, #to_s, xml_document, xml_string
Methods included from Helpers
#get_remote_file_as_string, #parsable_date?, #safely_parse_date
Instance Method Details
48
49
50
51
52
53
54
|
# File 'lib/tv_rage/show.rb', line 48
def aliases
xml_doc.xpath('//akas/aka').collect do |aka|
if country = aka.attr("country")
[country.upcase.to_sym, aka.content.strip]
end
end.reject { |a| a.nil? }
end
|
#classification ⇒ Object
36
37
38
|
# File 'lib/tv_rage/show.rb', line 36
def classification
xpath('//classification').try(:downcase).try(:to_sym)
end
|
22
23
24
|
# File 'lib/tv_rage/show.rb', line 22
def country
xml_doc.xpath('//network').try(:attr, "country").try(:value)
end
|
30
31
32
33
34
|
# File 'lib/tv_rage/show.rb', line 30
def genres
xml_doc.xpath('//genres/genre').collect do |genre|
genre.content.strip
end.reject { |g| g.nil? }
end
|
40
41
42
|
# File 'lib/tv_rage/show.rb', line 40
def network
xpath('//network')
end
|
#network_id ⇒ Object
26
27
28
|
# File 'lib/tv_rage/show.rb', line 26
def network_id
xpath('//showid').try(:to_i)
end
|
#original_name ⇒ Object
10
11
12
|
# File 'lib/tv_rage/show.rb', line 10
def original_name
xpath('//showname')
end
|
44
45
46
|
# File 'lib/tv_rage/show.rb', line 44
def runtime
xpath('//runtime').try(:to_i).try(:*, 60)
end
|
14
15
16
|
# File 'lib/tv_rage/show.rb', line 14
def started
xpath('//started').try(:to_i)
end
|
18
19
20
|
# File 'lib/tv_rage/show.rb', line 18
def status
xpath('//status').try(:downcase).try(:gsub, /\W/, '_').try(:to_sym)
end
|