Class: Imdb::Episode
Instance Attribute Summary collapse
-
#episode ⇒ Object
Returns the value of attribute episode.
-
#episode_title ⇒ Object
Returns the value of attribute episode_title.
-
#season ⇒ Object
Returns the value of attribute season.
Attributes inherited from Base
#also_known_as, #id, #title, #url
Instance Method Summary collapse
-
#air_date ⇒ Object
Return the original air date for this episode.
-
#initialize(imdb_id, season, episode, episode_title) ⇒ Episode
constructor
A new instance of Episode.
Methods inherited from Base
#cast_characters, #cast_member_ids, #cast_members, #cast_members_characters, #company, #countries, #director, #filming_locations, #genres, #languages, #length, #mpaa_rating, #plot, #plot_summary, #plot_synopsis, #poster, #rating, #release_date, #tagline, #trailer_url, #votes, #year
Constructor Details
#initialize(imdb_id, season, episode, episode_title) ⇒ Episode
Returns a new instance of Episode.
5 6 7 8 9 10 |
# File 'lib/imdb/episode.rb', line 5 def initialize(imdb_id, season, episode, episode_title) super(imdb_id, episode_title) @url = "http://akas.imdb.com/title/tt#{imdb_id}/combined" @season = season @episode = episode end |
Instance Attribute Details
#episode ⇒ Object
Returns the value of attribute episode.
3 4 5 |
# File 'lib/imdb/episode.rb', line 3 def episode @episode end |
#episode_title ⇒ Object
Returns the value of attribute episode_title.
3 4 5 |
# File 'lib/imdb/episode.rb', line 3 def episode_title @episode_title end |
#season ⇒ Object
Returns the value of attribute season.
3 4 5 |
# File 'lib/imdb/episode.rb', line 3 def season @season end |
Instance Method Details
#air_date ⇒ Object
Return the original air date for this episode
13 14 15 |
# File 'lib/imdb/episode.rb', line 13 def air_date document.at("h5[text()*='Original Air Date'] ~ div").content.strip.split("\n").first.strip rescue nil end |