Sha256: 26b701e9815419f787ded015ea1d0956d461569dac5c8d10d5b18d8d88644f56

Contents?: true

Size: 421 Bytes

Versions: 8

Compression:

Stored size: 421 Bytes

Contents

# @imdb_movie.poster.should == 'http://ia.media-imdb.com/images/M/MV5BMTkzODA5ODYwOV5BMl5BanBnXkFtZTcwMjAyNDYyMQ@@._V1._SX216_SY316_.jpg'

class ImdbImage
  
  attr_accessor :url
  
  def initialize(url)
    @url = File.join("http://www.imdb.com/", url)
  end
  
  def image
    document.at("table#principal tr td img")['src'] rescue nil
  end
  
  def document
    @document ||= Hpricot(open(self.url).read)
  end
  
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
kieranj-imdb-0.0.5 lib/imdb/imdb_image.rb
royw-imdb-0.0.10 lib/imdb/imdb_image.rb
royw-imdb-0.0.11 lib/imdb/imdb_image.rb
royw-imdb-0.0.12 lib/imdb/imdb_image.rb
royw-imdb-0.0.13 lib/imdb/imdb_image.rb
royw-imdb-0.0.14 lib/imdb/imdb_image.rb
royw-imdb-0.0.8 lib/imdb/imdb_image.rb
royw-imdb-0.0.9 lib/imdb/imdb_image.rb