dialog-api 0.0.3 → 0.0.4
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 +4 -4
- data/lib/dialog-api/api/interlocutor.rb +3 -3
- data/lib/dialog-api/api/track.rb +1 -21
- data/lib/dialog-api/request.rb +2 -2
- data/lib/dialog-api/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9213073b6314b581df5759f5bbdf498dd304cc22
|
4
|
+
data.tar.gz: f5946953b8f8e0fab87b81a4604f2b2f8a8149c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 393ce237a39b860c5d5b1717081075ef51fe790341704d97554f8b2094547c4bf3c56f64104b91cc057f50c30eb1665486d099a6f8f01441efe5493cfeb6b5fa
|
7
|
+
data.tar.gz: e3bea1991a7fc820d791d23eae1787cd1bbc890a9248b32636abda69d375fdb192415d8d254b8b96ff82669a8c055d2aab333c09d144352d712a39ef32f73796
|
@@ -16,10 +16,10 @@ module Dialog
|
|
16
16
|
end
|
17
17
|
|
18
18
|
# Creates an interlocutor
|
19
|
-
# @param
|
19
|
+
# @param payload [Hash]
|
20
20
|
# @return [Hash]
|
21
|
-
def create_interlocutor(
|
22
|
-
post("b/#{bot_id}/interlocutors", body: { interlocutor:
|
21
|
+
def create_interlocutor(payload)
|
22
|
+
post("b/#{bot_id}/interlocutors", body: { interlocutor: payload })
|
23
23
|
end
|
24
24
|
end
|
25
25
|
end
|
data/lib/dialog-api/api/track.rb
CHANGED
@@ -6,27 +6,7 @@ module Dialog
|
|
6
6
|
# @param payload [Hash]
|
7
7
|
# @return
|
8
8
|
def track(payload)
|
9
|
-
body
|
10
|
-
message: {
|
11
|
-
distinct_id: payload[:distinct_id],
|
12
|
-
platform: payload[:platform],
|
13
|
-
provider: payload[:provider],
|
14
|
-
mtype: payload[:mtype],
|
15
|
-
sent_at: payload[:sent_at],
|
16
|
-
properties: {
|
17
|
-
text: payload[:text]
|
18
|
-
}
|
19
|
-
},
|
20
|
-
conversation: {
|
21
|
-
distinct_id: payload[:conversation_distinct_id]
|
22
|
-
},
|
23
|
-
creator: {
|
24
|
-
distinct_id: payload[:creator_distinct_id],
|
25
|
-
type: payload[:creator_type]
|
26
|
-
}
|
27
|
-
}
|
28
|
-
|
29
|
-
post("b/#{bot_id}/track", body: body)
|
9
|
+
post("b/#{bot_id}/track", body: payload)
|
30
10
|
end
|
31
11
|
end
|
32
12
|
end
|
data/lib/dialog-api/request.rb
CHANGED
@@ -26,8 +26,8 @@ module Dialog
|
|
26
26
|
# @return [HTTP::Client]
|
27
27
|
# @raise [ArgumentError]
|
28
28
|
def request(method, path, params: {}, body: {})
|
29
|
-
raise ArgumentError, ("Please configure Dialog.api_token first")
|
30
|
-
raise ArgumentError, ("Please configure Dialog.bot_id first")
|
29
|
+
raise ArgumentError, ("Please configure Dialog.api_token first") if api_token.nil? || api_token.empty?
|
30
|
+
raise ArgumentError, ("Please configure Dialog.bot_id first") if bot_id.nil? || bot_id.empty?
|
31
31
|
|
32
32
|
headers = {
|
33
33
|
'Accept' => "application/json",
|
data/lib/dialog-api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dialog-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Philippe Dionne
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-12-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http
|
@@ -61,7 +61,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
61
61
|
version: '0'
|
62
62
|
requirements: []
|
63
63
|
rubyforge_project:
|
64
|
-
rubygems_version: 2.5.
|
64
|
+
rubygems_version: 2.5.2
|
65
65
|
signing_key:
|
66
66
|
specification_version: 4
|
67
67
|
summary: A ruby client for the Dialog API.
|