ofsys 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b156d499ef641aa42ea6c882af38fe9f405c9fd0
|
4
|
+
data.tar.gz: 6b802b28f90cca910ec164bda18cc9dd803ccd0e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dedf529e253fd1b269ed9957e7860f61a18cddd14787206262669a7fe98929bc094152d73e124869c1e00af9a66a08d6eb73d4ae14185a9c826d593984aab943
|
7
|
+
data.tar.gz: 547075eee7f3c61667b8c4fdbe54e0f42fbeb87965e8fb69a80eb2365f2b005acf8e1ce08b95f54356bd54b3cd8429dc9c944d43afc2cffebc8f12431417c0dd
|
data/lib/ofsys/request/base.rb
CHANGED
@@ -5,6 +5,14 @@ module Ofsys
|
|
5
5
|
class Base
|
6
6
|
class FailedError < RuntimeError; end
|
7
7
|
|
8
|
+
class << self
|
9
|
+
@suppress_id_project = false
|
10
|
+
|
11
|
+
def suppress_id_project
|
12
|
+
@id_project = true
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
8
16
|
def initialize(config = Ofsys.config)
|
9
17
|
@id_key = config.id_key
|
10
18
|
@key = config.key
|
@@ -41,6 +49,7 @@ module Ofsys
|
|
41
49
|
|
42
50
|
def body(source_params)
|
43
51
|
params = merge_auth(source_params)
|
52
|
+
params.merge!(idProject: @id_project) unless suppress_id_project?
|
44
53
|
to_json(params)
|
45
54
|
end
|
46
55
|
|
@@ -57,11 +66,14 @@ module Ofsys
|
|
57
66
|
AuthKey: {
|
58
67
|
Key: @key,
|
59
68
|
idKey: @id_key
|
60
|
-
}
|
61
|
-
idProject: @id_project
|
69
|
+
}
|
62
70
|
)
|
63
71
|
end
|
64
72
|
|
73
|
+
def suppress_id_project?
|
74
|
+
self.class.instance_variable_get(:@suppress_id_project)
|
75
|
+
end
|
76
|
+
|
65
77
|
def decode_result(body)
|
66
78
|
result = to_hash(body)
|
67
79
|
fail FailedError.new(body) unless result['Success']
|
data/lib/ofsys/version.rb
CHANGED
data/spec/contacts_merge_spec.rb
CHANGED
@@ -52,7 +52,7 @@ describe Ofsys::Request::ContactsMerge do
|
|
52
52
|
|
53
53
|
it 'performs correct request with passed data' do
|
54
54
|
VCR.use_cassette('contacts_merge') do
|
55
|
-
expect(described_class.new.perform(data)).to
|
55
|
+
expect(described_class.new.perform(data)).to eq(result)
|
56
56
|
end
|
57
57
|
end
|
58
58
|
end
|