fasttrack-client 1.0.1 → 1.0.2

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: c57cd3ba01fb172a65ff03d04a1d76c7085297a9
4
- data.tar.gz: bbf4d3f03954945448815b718d62cfd68ec298fe
3
+ metadata.gz: 69fccfa322e93742a531ab13e7ed2140d631dbbf
4
+ data.tar.gz: 8dd122fc9e236137977f861def62d94de96a7de0
5
5
  SHA512:
6
- metadata.gz: '08af2f6542b856acf5613048e38444caa4d848e01ba2552354d5913358f669212681757423707f1180e4e720fcbbd2c0738b0f2f296478082a3594cc3edb043e'
7
- data.tar.gz: 93961fea34af8adc873f67a18fca4cd26ff5050b3bbb8e7037e58847b64ac6d297dfa7ff4c9af2ec7e3d24e6fde19ef63aa421dbf7e8c17819eebd8062f792ba
6
+ metadata.gz: c0a3a3200567198b4278d930f6432238ce551022cc65ec69404c35bd2148e92cc6aa69ab89f67ef7ea7a73dffaa00faf5e304363cf8c02d9b043eb6a9ca3bb65
7
+ data.tar.gz: 3279ede144289cf98ed34f55244be10f98e45107eed10821997f253b1a3304f40afaf6b2c3cbab9f86ecc04ff9138da3dea86acf45b91890027139d0aa27bce9
@@ -2,45 +2,78 @@
2
2
  module FastTrack
3
3
  # Bad parameters
4
4
  class BadParametersException < Exception
5
+ def initialize(message = 'Send parameters through GET method')
6
+ super(message)
7
+ end
5
8
  end
6
9
 
7
10
  # Bad request
8
11
  class BadRequestException < Exception
12
+ def initialize(message = 'Request is malformed')
13
+ super(message)
14
+ end
9
15
  end
10
16
 
11
17
  # Internal server error
12
18
  class InternalServerException < Exception
19
+ def initialize(message = '')
20
+ super(message)
21
+ end
13
22
  end
14
23
 
15
24
  # Invalid version
16
25
  class InvalidVersionException < Exception
26
+ def initialize(message = 'API version is invalid')
27
+ super(message)
28
+ end
17
29
  end
18
30
 
19
31
  # Method not allowed
20
32
  class MethodNotAllowedException < Exception
33
+ def initialize(message = 'You tried to access an endpoint with an invalid method')
34
+ super(message)
35
+ end
21
36
  end
22
37
 
23
38
  # No result
24
39
  class NoResultException < Exception
40
+ def initialize(message = 'No result matching your request')
41
+ super(message)
42
+ end
25
43
  end
26
44
 
27
45
  # Not acceptable
28
46
  class NotAcceptableException < Exception
47
+ def initialize(message = 'You requested a format that is not json')
48
+ super(message)
49
+ end
29
50
  end
30
51
 
31
52
  # Not found
32
53
  class NotFoundException < Exception
54
+ def initialize(message = 'Specified endpoint could not be found')
55
+ super(message)
56
+ end
33
57
  end
34
58
 
35
59
  # Too many requests
36
60
  class TooManyRequestsException < Exception
61
+ def initialize(message = 'You made too many requests on the API in a short period of time')
62
+ super(message)
63
+ end
37
64
  end
38
65
 
39
66
  # Unauthorized
40
67
  class UnauthorizedException < Exception
68
+ def initialize(message = 'API key is wrong')
69
+ super(message)
70
+ end
41
71
  end
42
72
 
43
73
  # Version required
44
74
  class VersionRequiredException < Exception
75
+ def initialize(message = 'Send API version in the HTTP Accept headers')
76
+ super(message)
77
+ end
45
78
  end
46
79
  end
@@ -1,4 +1,4 @@
1
- require 'JSON'
1
+ require 'json'
2
2
  require 'rest-client'
3
3
 
4
4
  require_relative './common'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fasttrack-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fast Track