rotten-party 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/rotten-party/client.rb +10 -4
- data/rotten-party.gemspec +1 -1
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
data/lib/rotten-party/client.rb
CHANGED
@@ -25,15 +25,15 @@ module RottenParty
|
|
25
25
|
|
26
26
|
# Find a specific film by it's identifier
|
27
27
|
def find_film_by_id(id, options={})
|
28
|
-
options.
|
28
|
+
options = options.recurse_merge(@global_options)
|
29
29
|
response = self.class.get("/movies/#{id}.json", options).parsed_response
|
30
30
|
Hashie::Mash.new(response)
|
31
31
|
end
|
32
32
|
|
33
33
|
# Find a film by it's title
|
34
34
|
def find_film_by_title(title, options={})
|
35
|
-
options.
|
36
|
-
options.
|
35
|
+
options = options.recurse_merge(@global_options)
|
36
|
+
options = options.recurse_merge({:query => {:q => u(title)}})
|
37
37
|
response = self.class.get("/movies.json", options).parsed_response
|
38
38
|
Hashie::Mash.new(response["movies"].first)
|
39
39
|
end
|
@@ -48,9 +48,15 @@ module RottenParty
|
|
48
48
|
# => 'dvds'
|
49
49
|
# => 'movies'
|
50
50
|
def find_movies_in_list(list, directory, options={})
|
51
|
-
options.
|
51
|
+
options = options.recurse_merge(@global_options)
|
52
52
|
response = self.class.get("/lists/#{directory}/#{list}.json", options).parsed_response
|
53
53
|
response["movies"].collect{ |movie| Hashie::Mash.new(movie) }
|
54
54
|
end
|
55
55
|
end
|
56
|
+
|
57
|
+
def recurse_merge(a,b)
|
58
|
+
a.merge(b) do |_,x,y|
|
59
|
+
(x.is_a?(Hash) && y.is_a?(Hash)) ? recurse_merge(x,y) : [*x,*y]
|
60
|
+
end
|
61
|
+
end
|
56
62
|
end
|
data/rotten-party.gemspec
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: rotten-party
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.1.
|
5
|
+
version: 0.1.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Nick Pellant
|
@@ -116,7 +116,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
116
116
|
requirements:
|
117
117
|
- - ">="
|
118
118
|
- !ruby/object:Gem::Version
|
119
|
-
hash:
|
119
|
+
hash: -1643533933040285390
|
120
120
|
segments:
|
121
121
|
- 0
|
122
122
|
version: "0"
|