api_ai_wrapper 1.0.4 → 1.0.5

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: bad5503f39dd701eed3c4dfd90d830632a37fd2c
4
- data.tar.gz: 5f847be711f203214eef3ea1340011bb7f2233ec
3
+ metadata.gz: 744ddad2b8e3ef53416fa51c01310ce9e9496145
4
+ data.tar.gz: 1fd2fd3bb4aaa94d058e723f072bb00666d94ad7
5
5
  SHA512:
6
- metadata.gz: 59f828697c158ca608501b3901d39784e9a6fb86874ec5e8a464e0983490b629c037257ab29faee484d3879c28868a20adfbceefb725dab2663c1876c44bb0ec
7
- data.tar.gz: 5507caece3003dc208f206be234c7390360985718507e8f7fbac02b4533f772601c0165e0ac17f7944d61b0590ef17047f1c0d992daf8cfe32680762d7e1f5ac
6
+ metadata.gz: 7be4ded8324e35c2a70338097031042e363531471136496e3d0fd1b6f9d600d88167fcce4c99a7a31dcc3ed7fcfa5e132ab9881238cdc1aad1da8e1d20a8f007
7
+ data.tar.gz: 00e09de88d9f523bd193af18e57128f47d9bb78d23d7e0017421b6562a48289d48abf3cef10bde3edb338cbb26bd15a9581f34838165b44a31b0889b66176f9e
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- api_ai_wrapper (1.0.3)
4
+ api_ai_wrapper (1.0.4)
5
5
  httpclient (~> 2.8, >= 2.8.0)
6
6
 
7
7
  GEM
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'api_ai_wrapper'
3
- s.version = '1.0.4'
3
+ s.version = '1.0.5'
4
4
  s.date = '2017-08-04'
5
5
  s.summary = "An API.AI Ruby Wrapper"
6
6
  s.description = "A simple ruby library that let's any developer automate the training process of a Natural Language Processing Engine on API.AI, and retrieve meaning from new utterances."
@@ -1,28 +1,34 @@
1
1
  class ApiAiWrapper::Errors
2
2
 
3
- module Request
4
- class UnsupportedParams < StandardError; end
5
- end
6
-
7
3
  module Engine
8
- class MissingTokens < StandardError
9
- def initialize(_message = "You have not set a developer or client token for this engine")
10
- @message = _message
4
+ class Error < StandardError
5
+ def to_s
6
+ @message
11
7
  end
12
8
  end
13
9
 
14
- class MissingToken < StandardError
15
- def initialize(_message)
16
- @message = "Unauthorized call - #{_message}"
10
+ class MissingTokens < Error
11
+ def initialize(message = nil)
12
+ @message = message || "You have not set a developer or client token for this engine."
13
+ end
14
+ end
15
+
16
+ class MissingToken < Error
17
+ attr_reader :code
18
+
19
+ def initialize(message = nil)
20
+ @message = message || "Unauthorized call."
17
21
  @code = 401
18
22
  end
19
23
  end
20
24
 
21
- class ApiError < StandardError
22
- def initialize(_message, _code, _status)
23
- @message = _message
24
- @code = _code
25
- @status = _status
25
+ class ApiError < Error
26
+ attr_reader :code, :status
27
+
28
+ def initialize(message = nil, code = nil, status = nil)
29
+ @message = message || "An error occured in API.AI."
30
+ @code = code
31
+ @status = status
26
32
  end
27
33
  end
28
34
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: api_ai_wrapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vincent Gabou