vng 3.1.0 → 3.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/vng/lead.rb +8 -4
- data/lib/vng/mock_request.rb +1 -0
- data/lib/vng/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b010ddfb951a8a49807d40e1eae41355cfac53f9eb4774143e3b86ffbc4b892b
|
4
|
+
data.tar.gz: c495b73abd2a24b93f7fe0556a1ede1a48adeb9e08b19809099d9c95134c9fb6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50527cbbbbb3e550b54052dd9ff42e511d24fcf6904687ad46b1a7f931882a4064fed2db14243ca4f8d5c890147f806c7f2a7dbb33ff0708848b7e09448bc79b
|
7
|
+
data.tar.gz: 7611cfffca87c56f59a39e526386ebd1c224d65c6d8be53d86518f0f5dc2a616c3d80e6d4242032939a5bc6380dd259bb95a133fec775bb67f3288b4d51ff328
|
data/CHANGELOG.md
CHANGED
data/lib/vng/lead.rb
CHANGED
@@ -5,16 +5,17 @@ module Vng
|
|
5
5
|
class Lead < Resource
|
6
6
|
PATH = '/api/v1/data/Leads/'
|
7
7
|
|
8
|
-
attr_reader :id, :name, :email, :phone
|
8
|
+
attr_reader :id, :name, :email, :phone, :notes
|
9
9
|
|
10
|
-
def initialize(id:, name:, email:, phone:)
|
10
|
+
def initialize(id:, name:, email:, phone:, notes:)
|
11
11
|
@id = id
|
12
12
|
@name = name
|
13
13
|
@email = email
|
14
14
|
@phone = phone
|
15
|
+
@notes = notes
|
15
16
|
end
|
16
17
|
|
17
|
-
def self.create(name:, email:, phone:)
|
18
|
+
def self.create(name:, email:, phone:, notes: nil)
|
18
19
|
body = {
|
19
20
|
method: '3',
|
20
21
|
Fields: [
|
@@ -25,14 +26,17 @@ module Vng
|
|
25
26
|
]
|
26
27
|
}
|
27
28
|
|
29
|
+
body[:Fields] << { fieldID: 108, fieldValue: notes } if notes
|
30
|
+
|
28
31
|
data = request path: PATH, body: body
|
29
32
|
|
30
33
|
id = data['Client']['objectID']
|
31
34
|
name = value_for_field data, 127
|
32
35
|
email = value_for_field data, 238
|
33
36
|
phone = value_for_field data, 1024
|
37
|
+
notes = value_for_field data, 108
|
34
38
|
|
35
|
-
new id: id, name: name, email: email, phone: phone
|
39
|
+
new id: id, name: name, email: email, phone: phone, notes: notes
|
36
40
|
end
|
37
41
|
end
|
38
42
|
end
|
data/lib/vng/mock_request.rb
CHANGED
@@ -118,6 +118,7 @@ module Vng
|
|
118
118
|
{ "fieldID"=>126, "fieldValue"=>"Vng Example" },
|
119
119
|
{ "fieldID"=>238, "fieldValue"=>"vng@example.com" },
|
120
120
|
{ "fieldID"=>1024, "fieldValue"=>"8648648640" },
|
121
|
+
{ "fieldID"=>108, "fieldValue"=>"Lead notes" },
|
121
122
|
] }
|
122
123
|
end
|
123
124
|
when '/api/v1/data/Contacts/'
|
data/lib/vng/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vng
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- claudiob
|
8
8
|
bindir: exe
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-01-
|
10
|
+
date: 2025-01-15 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: simplecov
|