zendesk_api 1.29.0 → 1.30.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/zendesk_api/client.rb +5 -0
- data/lib/zendesk_api/configuration.rb +4 -0
- data/lib/zendesk_api/resources.rb +2 -0
- data/lib/zendesk_api/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 793f89bec6ccc7c03d9fe870346da6f50dc0dd8cde3b46aca5b37cc6504adb3a
|
4
|
+
data.tar.gz: a03de27f833f3d9395bd44f574e70f8c3d9c6e10a06f4b89f71c2e393c0ea1a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4426a2dfad01605c661fbe4f71312e86bc444479dc4c293876273c5003169d32774e79b55e2f7c67b54a7cbb48ce0feb32887484f02f73da536c366dc8ac5c7
|
7
|
+
data.tar.gz: f561f3b726990c014aeaa095c21f6065063100bf033c3ce1fafaaa8fa062240dbe068960d9482cab632579e8890986e24db205bdcf40f1034468d94db37b7864
|
data/lib/zendesk_api/client.rb
CHANGED
@@ -40,6 +40,11 @@ module ZendeskAPI
|
|
40
40
|
method = method.to_s
|
41
41
|
options = args.last.is_a?(Hash) ? args.pop : {}
|
42
42
|
|
43
|
+
unless config.use_resource_cache
|
44
|
+
raise "Resource for #{method} does not exist" unless method_as_class(method)
|
45
|
+
return ZendeskAPI::Collection.new(self, method_as_class(method), options)
|
46
|
+
end
|
47
|
+
|
43
48
|
@resource_cache[method] ||= { :class => nil, :cache => ZendeskAPI::LRUCache.new }
|
44
49
|
if !options.delete(:reload) && (cached = @resource_cache[method][:cache].read(options.hash))
|
45
50
|
cached
|
@@ -42,8 +42,12 @@ module ZendeskAPI
|
|
42
42
|
# @return [ZendeskAPI::LRUCache]
|
43
43
|
attr_accessor :cache
|
44
44
|
|
45
|
+
# @return [Boolean] Whether to use resource_cache or not
|
46
|
+
attr_accessor :use_resource_cache
|
47
|
+
|
45
48
|
def initialize
|
46
49
|
@client_options = {}
|
50
|
+
@use_resource_cache = true
|
47
51
|
|
48
52
|
self.cache = ZendeskAPI::LRUCache.new(1000)
|
49
53
|
end
|
data/lib/zendesk_api/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zendesk_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.30.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven Davidovitz
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2021-
|
12
|
+
date: 2021-06-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faraday
|
@@ -143,9 +143,9 @@ licenses:
|
|
143
143
|
- Apache-2.0
|
144
144
|
metadata:
|
145
145
|
bug_tracker_uri: https://github.com/zendesk/zendesk_api_client_rb/issues
|
146
|
-
changelog_uri: https://github.com/zendesk/zendesk_api_client_rb/blob/v1.
|
147
|
-
documentation_uri: https://www.rubydoc.info/gems/zendesk_api/1.
|
148
|
-
source_code_uri: https://github.com/zendesk/zendesk_api_client_rb/tree/v1.
|
146
|
+
changelog_uri: https://github.com/zendesk/zendesk_api_client_rb/blob/v1.30.0/CHANGELOG.md
|
147
|
+
documentation_uri: https://www.rubydoc.info/gems/zendesk_api/1.30.0
|
148
|
+
source_code_uri: https://github.com/zendesk/zendesk_api_client_rb/tree/v1.30.0
|
149
149
|
wiki_uri: https://github.com/zendesk/zendesk_api_client_rb/wiki
|
150
150
|
post_install_message:
|
151
151
|
rdoc_options: []
|