cfoundry 0.3.55 → 0.3.56

Sign up to get free protection for your applications and to get access to all the features.
@@ -148,12 +148,12 @@ module CFoundry::V2
148
148
  end
149
149
 
150
150
  define_method(plural) { |*args|
151
- if cache = @cache[plural]
151
+ depth, query = args
152
+
153
+ if !depth && !query && cache = @cache[plural]
152
154
  return cache
153
155
  end
154
156
 
155
- depth, query = args
156
-
157
157
  if @manifest && @manifest[:entity].key?(plural) && !depth
158
158
  objs = @manifest[:entity][plural]
159
159
 
@@ -163,18 +163,24 @@ module CFoundry::V2
163
163
  objs = objs.select { |o| o[:entity][find_by] == find_val }
164
164
  end
165
165
 
166
- @cache[plural] =
166
+ res =
167
167
  objs.collect do |json|
168
168
  @client.send(:"make_#{object}", json)
169
169
  end
170
170
  else
171
- @cache[plural] =
171
+ res =
172
172
  @client.send(
173
173
  :"#{plural_object}_from",
174
174
  "/v2/#{object_name}s/#@guid/#{plural}",
175
175
  depth || opts[:depth],
176
176
  query)
177
177
  end
178
+
179
+ unless depth || query
180
+ @cache[plural] = res
181
+ end
182
+
183
+ res
178
184
  }
179
185
 
180
186
  define_method(:"#{plural}_url") {
@@ -1,4 +1,4 @@
1
1
  module CFoundry # :nodoc:
2
2
  # CFoundry library version number.
3
- VERSION = "0.3.55"
3
+ VERSION = "0.3.56"
4
4
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cfoundry
3
3
  version: !ruby/object:Gem::Version
4
- hash: 125
4
+ hash: 99
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 55
10
- version: 0.3.55
9
+ - 56
10
+ version: 0.3.56
11
11
  platform: ruby
12
12
  authors:
13
13
  - Alex Suraci