ruby-imdb 0.7.1 → 0.7.2

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.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/lib/imdb/skeleton.rb +13 -10
  3. data/ruby-imdb.gemspec +1 -1
  4. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.7.1
1
+ 0.7.2
@@ -1,5 +1,5 @@
1
1
  module IMDB
2
- # Interface of IMDB data classes.
2
+ # IMDB generic interface.
3
3
  class Skeleton
4
4
  attr_accessor :model, :method_names
5
5
 
@@ -9,8 +9,8 @@ module IMDB
9
9
  include MongoMapper::Document
10
10
  set_collection_name model_name
11
11
  method_names.each { |m, t|
12
- key m, t
13
- }
12
+ key m, t
13
+ }
14
14
  end
15
15
  class_eval do
16
16
  method_names.each_key { |meth|
@@ -31,11 +31,14 @@ module IMDB
31
31
  a = send(old_meth)
32
32
  if a.kind_of?(Array)
33
33
  a.compact!
34
- #a.map! {
35
- # |c|
36
- # c.to_hash
37
- #}.compact
38
- @db_query[meth] = a
34
+ a.map! { |c|
35
+ if c.kind_of?(String)
36
+ c
37
+ else
38
+ c.to_hash
39
+ end
40
+ }
41
+ @db_query[meth] = a
39
42
  else
40
43
  @db_query[meth] = a
41
44
  end
@@ -57,7 +60,6 @@ module IMDB
57
60
  tmp_hash.to_json(*a)
58
61
  end
59
62
 
60
-
61
63
  def to_hash(*a)
62
64
  tmp_hash = {}
63
65
  @method_names.each_key { |x|
@@ -77,4 +79,5 @@ module IMDB
77
79
  new(*o['data'])
78
80
  end
79
81
  end
80
- end
82
+ end
83
+
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ruby-imdb}
8
- s.version = "0.7.1"
8
+ s.version = "0.7.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Yalcin Acikyildiz"]
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 7
8
- - 1
9
- version: 0.7.1
8
+ - 2
9
+ version: 0.7.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Yalcin Acikyildiz