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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 02ed483cd09ee8a1a14f90916f1ca117cc2d4897
4
- data.tar.gz: fe68258e00062988a78424c8dd0e299036a7566c
3
+ metadata.gz: 9213073b6314b581df5759f5bbdf498dd304cc22
4
+ data.tar.gz: f5946953b8f8e0fab87b81a4604f2b2f8a8149c4
5
5
  SHA512:
6
- metadata.gz: 80e742906a72a23c9c3a67dfdb63d597f03d5d6e4a63713d6299b64391e3fb486554ea731393484669b10452f165b31c5f024e81752104e35d73638de8a769de
7
- data.tar.gz: 695decfed992c2119ce107f97feaaab9179247bb2ade2cb80e985eda3e2486efb59011bbde071b38f0d90efd9a01f20f7e9fcc7caa1dd8e29a91c51f7dd27191
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 attributes [Hash]
19
+ # @param payload [Hash]
20
20
  # @return [Hash]
21
- def create_interlocutor(attributes)
22
- post("b/#{bot_id}/interlocutors", body: { interlocutor: attributes })
21
+ def create_interlocutor(payload)
22
+ post("b/#{bot_id}/interlocutors", body: { interlocutor: payload })
23
23
  end
24
24
  end
25
25
  end
@@ -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
@@ -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") unless api_token
30
- raise ArgumentError, ("Please configure Dialog.bot_id first") unless bot_id
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",
@@ -1,3 +1,3 @@
1
1
  module Dialog
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
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.3
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-04 00:00:00.000000000 Z
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.1
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.