pipe_drive_ruby_wrapper 0.1.1 → 0.1.2

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
  SHA256:
3
- metadata.gz: b284c3238b3325431be152a084566d4b72d37c5ff297bfb11454f5efcd30f9b1
4
- data.tar.gz: f78170f0a97ec45b6a37d7e0a857c64b161ca549fb60b96c585028f90dac0a69
3
+ metadata.gz: a9b50ed4edd763c946020df487a8496cfd93f735bbe56997852c275c06f9b167
4
+ data.tar.gz: 6b764e401e857eca56fdb153ff34321b47f2d6b822e5fabcdcbf9a1f2db87f8f
5
5
  SHA512:
6
- metadata.gz: '088ea8e8b1baeb2f2cbf68bfb5b391c0095d485a5ebc1dca1de372930dd6b213366b555c0f5e501d1223ee9ca82af537d2f2f21f532f387e2ae8fc506a7641ac'
7
- data.tar.gz: 7d20b3d12674a628bf73a2d1c176ac3e08e485bdbb466bfe25b06d6a11e1fdef2fe6569cf439bb915475e056afd3c8f9ea805ae9c9aa15d90e4ed32de73c4749
6
+ metadata.gz: 2619b139fae104ad62b4d702437c06144dbffce66b159d56d27e1ec064016e429af739f3ed6b14ce6858a3f7fb541dc0343ed3a9721ac1e6600dc66df9bee580
7
+ data.tar.gz: '092850318dd9d7c152b40c33a1a5d5dd6ef0ab5c75faebddf53a3185563c27cb8949bc9e24952517ed846146fe79101a65df080949feedc3c1588a9dc2b1f286'
@@ -46,7 +46,7 @@ module PipeDrive
46
46
  cache_field_name = parameterize(field_name, '_').to_sym
47
47
  pipedrive_key = cache_keys[cache_field_name]
48
48
  return pipedrive_key unless pipedrive_key.nil?
49
- PipeDrive.field_keys = nil
49
+ PipeDrive.reset_field_keys!
50
50
  pipedrive_key = cache_keys[cache_field_name]
51
51
  if pipedrive_key.nil?
52
52
  raise TargetNotFound.new(self.name, :name, field_name)
@@ -68,7 +68,7 @@ module PipeDrive
68
68
  result = {status: response.code.to_i}
69
69
 
70
70
  begin
71
- body = Oj.load(response.body)
71
+ body = JSON.parse(response.body)
72
72
  rescue
73
73
  body = {body: response.body}
74
74
  end
@@ -1,6 +1,5 @@
1
1
  require 'net/http'
2
2
  require 'ostruct'
3
- require 'oj'
4
3
  require 'json'
5
4
 
6
5
  module PipeDrive
@@ -29,11 +28,23 @@ module PipeDrive
29
28
  @field_keys
30
29
  end
31
30
 
31
+ def reset_field_keys!
32
+ @field_keys = {}
33
+ FIELD_CLASSES.each do |class_name|
34
+ @field_keys.merge!(const_get(class_name).field_keys_map)
35
+ end
36
+ @field_keys
37
+ end
38
+
32
39
  def stage_ids
33
40
  return @stage_ids unless @stage_ids.nil? || @stage_ids.empty?
34
41
  @stage_ids = Stage.stage_ids_map
35
42
  end
36
43
 
44
+ def reset_stage_ids!
45
+ @stage_ids = Stage.stage_ids_map
46
+ end
47
+
37
48
  def host
38
49
  "https://api.pipedrive.com"
39
50
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pipe_drive_ruby_wrapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - JiaRou Lee
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-31 00:00:00.000000000 Z
11
+ date: 2018-09-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -24,20 +24,6 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '3.0'
27
- - !ruby/object:Gem::Dependency
28
- name: oj
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '3.3'
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '3.3'
41
27
  description: ruby wrapper of some pipe drive api
42
28
  email: laura34963@kdanmobile.com
43
29
  executables: []