Sha256: 91fd0d048754f9ec2100438a39848060f967b4f6f79d2c35a7bd5e47a8d0b22b

Contents?: true

Size: 574 Bytes

Versions: 5

Compression:

Stored size: 574 Bytes

Contents

module Imdb
  
  class Serie < ImdbBase
    
    # s = Imdb::Serie.new("0773262")
    # e = s.seasons.first.episodes.first
    def number_seasons
      document.search("a[@href*=episodes#season']").size
    end

    def season_urls
      document.search("a[@href*=episodes#season']").map { |link| url.gsub("combined","") + "episodes#season-" + link.innerHTML.strip.imdb_unescape_html } rescue []
    end
    
    def seasons
      s = []
      season_urls.each_with_index do |url|
        s << Imdb::Season.new(url)
      end
      s
    end
      
  end  #Serie
end # Imdb

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
imdb_parser-1.0.3 lib/imdb_parser/serie.rb
imdb_parser-0.6.6 lib/imdb_parser/serie.rb
imdb_parser-1.0.2 lib/imdb/serie.rb
imdb_parser-1.0.1 lib/imdb/serie.rb
imdb_parser-1.0.0 lib/imdb/serie.rb