api_client_bulk_loader 0.1.9 → 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 79cd3536b6e86590d71001608bc335a6dbe84eda
|
4
|
+
data.tar.gz: eb1ed8fd002f4d76c72f0b6b4837595ed65cd472
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ada0ec42894766e71866a9421bc344c44efe48c46f7cf93abbd5e24b57e38ac306055ac6ae9af33ccf2c4eca836056e454e4511140df9c623aaf475b72132d8
|
7
|
+
data.tar.gz: 8566b7f227854e3ae0bc1d94c124b3284f6d019a0b07e688621a39f1ec489e7b809cec377dac9516ab4a3306898bd1b0c6bbfba5857ea88540924143f19db4fc
|
@@ -11,20 +11,22 @@ module ApiClientBulkLoader
|
|
11
11
|
@values_from = values_from
|
12
12
|
@has_one = is_has_one
|
13
13
|
@limit = limit
|
14
|
+
end
|
14
15
|
|
16
|
+
def bulk_loader
|
15
17
|
RequestStore.store[:bulk_loader] ||= ApiClientBulkLoader::Client::Loader.new
|
16
|
-
|
18
|
+
return RequestStore.store[:bulk_loader]
|
17
19
|
end
|
18
20
|
|
19
21
|
#Fetch.
|
20
22
|
def fetch(values)
|
21
|
-
results =
|
23
|
+
results = bulk_loader.fetch(@resource_model, values, @attribute)
|
22
24
|
return @has_one ? results.first : results
|
23
25
|
end
|
24
26
|
|
25
27
|
#Push.
|
26
28
|
def push(values)
|
27
|
-
|
29
|
+
bulk_loader.push(@resource_model, values, @attribute)
|
28
30
|
end
|
29
31
|
end
|
30
32
|
end
|
@@ -12,19 +12,22 @@ module ApiClientBulkLoader
|
|
12
12
|
@type_from = type_from
|
13
13
|
@has_one = is_has_one
|
14
14
|
@limit = limit
|
15
|
+
end
|
16
|
+
|
17
|
+
def bulk_loader
|
15
18
|
RequestStore.store[:bulk_loader] ||= ApiClientBulkLoader::Client::Loader.new
|
16
|
-
|
19
|
+
return RequestStore.store[:bulk_loader]
|
17
20
|
end
|
18
21
|
|
19
22
|
#Fetch.
|
20
23
|
def fetch(values, resource_type)
|
21
|
-
results =
|
24
|
+
results = bulk_loader.fetch(@resource_translation[resource_type], values, @attribute)
|
22
25
|
return @has_one ? results.first : results
|
23
26
|
end
|
24
27
|
|
25
28
|
#Push.
|
26
29
|
def push(values, resource_type)
|
27
|
-
|
30
|
+
bulk_loader.push(@resource_translation[resource_type], values, @attribute)
|
28
31
|
end
|
29
32
|
end
|
30
33
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: api_client_bulk_loader
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- alex
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|