Class: TVDB::Episode
- Inherits:
-
Object
- Object
- TVDB::Episode
- Defined in:
- lib/tvdb-rb/episode.rb
Instance Attribute Summary collapse
-
#director ⇒ Object
Returns the value of attribute director.
-
#episode_name ⇒ Object
Returns the value of attribute episode_name.
-
#episode_number ⇒ Object
Returns the value of attribute episode_number.
-
#first_aired ⇒ Object
Returns the value of attribute first_aired.
-
#guest_stars ⇒ Object
Returns the value of attribute guest_stars.
-
#imdb_id ⇒ Object
Returns the value of attribute imdb_id.
-
#language ⇒ Object
Returns the value of attribute language.
-
#overview ⇒ Object
Returns the value of attribute overview.
-
#production_code ⇒ Object
Returns the value of attribute production_code.
-
#rating ⇒ Object
Returns the value of attribute rating.
-
#rating_count ⇒ Object
Returns the value of attribute rating_count.
-
#season_number ⇒ Object
Returns the value of attribute season_number.
-
#series_id ⇒ Object
Returns the value of attribute series_id.
-
#tvdb_id ⇒ Object
Returns the value of attribute tvdb_id.
-
#writers ⇒ Object
Returns the value of attribute writers.
Instance Method Summary collapse
-
#initialize(client, xml) ⇒ Episode
constructor
A new instance of Episode.
- #to_array(string) ⇒ Object
Constructor Details
#initialize(client, xml) ⇒ Episode
Returns a new instance of Episode.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/tvdb-rb/episode.rb', line 7 def initialize client, xml @client = client # @raw_rsp = xml @tvdb_id = xml.xpath("id").text @episode_name = xml.xpath("EpisodeName").text @episode_number = xml.xpath("EpisodeNumber").text @first_aired = xml.xpath("FirstAired").text @guest_stars = to_array xml.xpath("GuestStars").text @imbdb_id = xml.xpath("IMDB_ID").text @language = xml.xpath("Language").text @overview = xml.xpath("Overview").text @production_code = xml.xpath("ProductionCode").text @rating = xml.xpath("Rating").text @rating_count = xml.xpath("RatingCount").text @season_number = xml.xpath("SeasonNumber").text @writers = to_array xml.xpath("Writer").text @directors = to_array xml.xpath("Director").text @season_id = xml.xpath("seasonid").text @series_id = xml.xpath("seriesid").text end |
Instance Attribute Details
#director ⇒ Object
Returns the value of attribute director.
5 6 7 |
# File 'lib/tvdb-rb/episode.rb', line 5 def director @director end |
#episode_name ⇒ Object
Returns the value of attribute episode_name.
5 6 7 |
# File 'lib/tvdb-rb/episode.rb', line 5 def episode_name @episode_name end |
#episode_number ⇒ Object
Returns the value of attribute episode_number.
5 6 7 |
# File 'lib/tvdb-rb/episode.rb', line 5 def episode_number @episode_number end |
#first_aired ⇒ Object
Returns the value of attribute first_aired.
5 6 7 |
# File 'lib/tvdb-rb/episode.rb', line 5 def first_aired @first_aired end |
#guest_stars ⇒ Object
Returns the value of attribute guest_stars.
5 6 7 |
# File 'lib/tvdb-rb/episode.rb', line 5 def guest_stars @guest_stars end |
#imdb_id ⇒ Object
Returns the value of attribute imdb_id.
5 6 7 |
# File 'lib/tvdb-rb/episode.rb', line 5 def imdb_id @imdb_id end |
#language ⇒ Object
Returns the value of attribute language.
5 6 7 |
# File 'lib/tvdb-rb/episode.rb', line 5 def language @language end |
#overview ⇒ Object
Returns the value of attribute overview.
5 6 7 |
# File 'lib/tvdb-rb/episode.rb', line 5 def overview @overview end |
#production_code ⇒ Object
Returns the value of attribute production_code.
5 6 7 |
# File 'lib/tvdb-rb/episode.rb', line 5 def production_code @production_code end |
#rating ⇒ Object
Returns the value of attribute rating.
5 6 7 |
# File 'lib/tvdb-rb/episode.rb', line 5 def @rating end |
#rating_count ⇒ Object
Returns the value of attribute rating_count.
5 6 7 |
# File 'lib/tvdb-rb/episode.rb', line 5 def @rating_count end |
#season_number ⇒ Object
Returns the value of attribute season_number.
5 6 7 |
# File 'lib/tvdb-rb/episode.rb', line 5 def season_number @season_number end |
#series_id ⇒ Object
Returns the value of attribute series_id.
5 6 7 |
# File 'lib/tvdb-rb/episode.rb', line 5 def series_id @series_id end |
#tvdb_id ⇒ Object
Returns the value of attribute tvdb_id.
5 6 7 |
# File 'lib/tvdb-rb/episode.rb', line 5 def tvdb_id @tvdb_id end |
#writers ⇒ Object
Returns the value of attribute writers.
5 6 7 |
# File 'lib/tvdb-rb/episode.rb', line 5 def writers @writers end |
Instance Method Details
#to_array(string) ⇒ Object
28 29 30 |
# File 'lib/tvdb-rb/episode.rb', line 28 def to_array string string.split("|").reject! { |c| c.empty? } end |