fasttrack-client 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/common.rb +9 -9
- data/lib/{fasttrack.rb → fasttrack-client.rb} +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c57cd3ba01fb172a65ff03d04a1d76c7085297a9
|
4
|
+
data.tar.gz: bbf4d3f03954945448815b718d62cfd68ec298fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '08af2f6542b856acf5613048e38444caa4d848e01ba2552354d5913358f669212681757423707f1180e4e720fcbbd2c0738b0f2f296478082a3594cc3edb043e'
|
7
|
+
data.tar.gz: 93961fea34af8adc873f67a18fca4cd26ff5050b3bbb8e7037e58847b64ac6d297dfa7ff4c9af2ec7e3d24e6fde19ef63aa421dbf7e8c17819eebd8062f792ba
|
data/lib/common.rb
CHANGED
@@ -16,24 +16,24 @@ ERRORS_BY_ERROR_CODE = {
|
|
16
16
|
'4' => FastTrack::InvalidVersionException
|
17
17
|
}
|
18
18
|
|
19
|
-
def
|
20
|
-
|
19
|
+
def exception_for_response(status, errorCode)
|
20
|
+
fast_track_error = nil
|
21
21
|
|
22
22
|
if errorCode != nil
|
23
|
-
|
23
|
+
fast_track_error = ERRORS_BY_ERROR_CODE[errorCode]
|
24
24
|
end
|
25
25
|
|
26
|
-
if
|
27
|
-
|
26
|
+
if fast_track_error == nil && status != nil
|
27
|
+
fast_track_error = ERRORS_BY_STATUS[status.to_s]
|
28
28
|
|
29
29
|
if status >= 500 && status < 600
|
30
|
-
|
30
|
+
fast_track_error = FastTrack::InternalServerException
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
-
if
|
35
|
-
|
34
|
+
if fast_track_error == nil
|
35
|
+
fast_track_error = Exception
|
36
36
|
end
|
37
37
|
|
38
|
-
return
|
38
|
+
return fast_track_error
|
39
39
|
end
|
@@ -35,20 +35,20 @@ module FastTrack
|
|
35
35
|
body = {}
|
36
36
|
end
|
37
37
|
|
38
|
-
exception =
|
38
|
+
exception = exception_for_response(response.code, body['error_code'])
|
39
39
|
raise exception, body['detail']
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
43
|
# Retrieve company details with a `domain`
|
44
|
-
def
|
44
|
+
def get_company(domain)
|
45
45
|
return self.get PATHNAME_COMPANY, {
|
46
46
|
'domain' => domain
|
47
47
|
}
|
48
48
|
end
|
49
49
|
|
50
50
|
# Retrieve contact details with an `email`
|
51
|
-
def
|
51
|
+
def get_contact(email)
|
52
52
|
return self.get PATHNAME_CONTACT, {
|
53
53
|
'email' => email
|
54
54
|
}
|
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.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fast Track
|
@@ -48,7 +48,7 @@ files:
|
|
48
48
|
- lib/common.rb
|
49
49
|
- lib/constants.rb
|
50
50
|
- lib/exceptions.rb
|
51
|
-
- lib/fasttrack.rb
|
51
|
+
- lib/fasttrack-client.rb
|
52
52
|
homepage: https://github.com/fasttrack/fasttrack-ruby
|
53
53
|
licenses:
|
54
54
|
- MIT
|