Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

slate -> trailer

  • Loading branch information...
commit 050c7073605b21a03ae5976ead4a0d2d86b1f774 1 parent 775d6ca
Jon Maddox authored
2  README.md
Source Rendered
@@ -24,7 +24,7 @@
24 24
25 25 movie = imdb.find_movie_by_id("tt1210166")
26 26
27   - movie.slate_url => "http://ia.media-imdb.com/images/M/MV5BODM1NDMxMTI3M15BMl5BanBnXkFtZTcwMDAzODY1Ng@@._V1_.jpg"
  27 + movie.trailer_url => "http://ia.media-imdb.com/images/M/MV5BODM1NDMxMTI3M15BMl5BanBnXkFtZTcwMDAzODY1Ng@@._V1_.jpg"
28 28
29 29 ### Find the top 250 movies of all time
30 30
4 imdb_party.gemspec
@@ -32,7 +32,7 @@ Gem::Specification.new do |s|
32 32 "test/movie_test.rb",
33 33 "test/person_test.rb",
34 34 "test/search_test.rb",
35   - "test/slate_test.rb",
  35 + "test/trailer_test.rb",
36 36 "test/test_helper.rb"
37 37 ]
38 38 s.homepage = %q{http://github.com/maddox/imdb_party}
@@ -44,7 +44,7 @@ Gem::Specification.new do |s|
44 44 "test/movie_test.rb",
45 45 "test/person_test.rb",
46 46 "test/search_test.rb",
47   - "test/slate_test.rb",
  47 + "test/trailer_test.rb",
48 48 "test/test_helper.rb"
49 49 ]
50 50
5 lib/imdb_party/movie.rb
... ... @@ -1,6 +1,6 @@
1 1 module ImdbParty
2 2 class Movie
3   - attr_accessor :imdb_id, :title, :directors, :writers, :tagline, :company, :plot, :runtime, :rating, :poster_url, :release_date, :certification, :genres, :actors, :trailers, :slate_url
  3 + attr_accessor :imdb_id, :title, :directors, :writers, :tagline, :company, :plot, :runtime, :rating, :poster_url, :release_date, :certification, :genres, :actors, :trailers, :trailer_url
4 4
5 5 def initialize(options={})
6 6 @imdb_id = options["tconst"]
@@ -13,8 +13,7 @@ def initialize(options={})
13 13 @release_date = options["release_date"]["normal"] if options["release_date"] && options["release_date"]["normal"]
14 14 @certification = options["certificate"]["certificate"] if options["certificate"] && options["certificate"]["certificate"]
15 15 @genres = options["genres"] || []
16   - # parse trailer poster
17   - @slate_url = options["trailer"]["slates"][0]["url"] if(options["trailer"] && options["trailer"]["slates"] && options["trailer"]["slates"][0])
  16 + @trailer_url = options["trailer"]["slates"][0]["url"] if(options["trailer"] && options["trailer"]["slates"] && options["trailer"]["slates"][0])
18 17
19 18 # parse directors
20 19 @directors = options["directors_summary"] ? options["directors_summary"].map { |d| Person.new(d) } : []
8 test/slate_test.rb → test/trailer_test.rb
... ... @@ -1,14 +1,14 @@
1 1 require 'test_helper'
2 2
3   -class SlateTest < Test::Unit::TestCase
4   - context "a slate" do
  3 +class TrailerTest < Test::Unit::TestCase
  4 + context "a trailer" do
5 5 setup do
6 6 @imdb = ImdbParty::Imdb.new
7 7 @movie = @imdb.find_movie_by_id("tt1210166")
8 8 end
9 9
10   - should "have a slate_url" do
11   - assert_match /http:\/\/ia.media-imdb.com\/images\/.*/, @movie.slate_url
  10 + should "have a trailer_url" do
  11 + assert_match /http:\/\/ia.media-imdb.com\/images\/.*/, @movie.trailer_url
12 12 end
13 13
14 14 end

0 comments on commit 050c707

Please sign in to comment.
Something went wrong with that request. Please try again.