jduff-tmdb_party 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 2
4
- :patch: 0
4
+ :patch: 1
data/lib/tmdb_party.rb CHANGED
@@ -4,6 +4,7 @@ require 'tmdb_party/core_extensions'
4
4
  require 'tmdb_party/attributes'
5
5
  require 'tmdb_party/video'
6
6
  require 'tmdb_party/category'
7
+ require 'tmdb_party/person'
7
8
  require 'tmdb_party/image'
8
9
  require 'tmdb_party/movie'
9
10
 
@@ -18,4 +18,4 @@ module TMDBParty
18
18
  end
19
19
  end
20
20
  end
21
- end
21
+ end
@@ -12,6 +12,7 @@ module TMDBParty
12
12
  attributes :homepage, :lazy => :get_info!
13
13
  attributes :trailer, :lazy => :get_info!, :type=> Video
14
14
  attributes :categories, :lazy => :get_info!, :type=> Category
15
+ attributes :people, :lazy => :get_info!, :type=> Person
15
16
 
16
17
  def initialize(values, tmdb)
17
18
  @tmdb = tmdb
@@ -0,0 +1,21 @@
1
+ module TMDBParty
2
+ class Person
3
+ include Attributes
4
+ attributes :name, :url, :job
5
+
6
+ def initialize(values)
7
+ self.attributes = values
8
+ end
9
+
10
+ def self.parse(data)
11
+ data = data["person"]
12
+ if data.is_a?(Array)
13
+ data.collect do |person|
14
+ Person.new(person)
15
+ end
16
+ else
17
+ Person.new(data)
18
+ end
19
+ end
20
+ end
21
+ end
@@ -40,6 +40,8 @@ class TestTmdbParty < Test::Unit::TestCase
40
40
 
41
41
 
42
42
  assert_equal 132, transformers.runtime
43
+ assert_equal 35, transformers.people.length
44
+
43
45
  # assert_equal 1.0, transformers.score
44
46
  # assert_equal 1.0, transformers.score
45
47
  # assert_equal 1.0, transformers.score
data/tmdb_party.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{tmdb_party}
8
- s.version = "0.2.0"
8
+ s.version = "0.2.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["John Duff"]
@@ -28,6 +28,7 @@ Gem::Specification.new do |s|
28
28
  "lib/tmdb_party/core_extensions.rb",
29
29
  "lib/tmdb_party/image.rb",
30
30
  "lib/tmdb_party/movie.rb",
31
+ "lib/tmdb_party/person.rb",
31
32
  "lib/tmdb_party/video.rb",
32
33
  "test/fixtures/imdb_no_results.xml",
33
34
  "test/fixtures/imdb_search.xml",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jduff-tmdb_party
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Duff
@@ -64,6 +64,7 @@ files:
64
64
  - lib/tmdb_party/core_extensions.rb
65
65
  - lib/tmdb_party/image.rb
66
66
  - lib/tmdb_party/movie.rb
67
+ - lib/tmdb_party/person.rb
67
68
  - lib/tmdb_party/video.rb
68
69
  - test/fixtures/imdb_no_results.xml
69
70
  - test/fixtures/imdb_search.xml