tiramizoo 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tiramizoo.rb +20 -0
- data/lib/tiramizoo/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c5e938e60cc50b2644d5cdd7201e72a7052b2ef1
|
4
|
+
data.tar.gz: bfe12e64de2a541dab8235f74f70d330aec0e1fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0be5860d11f7849d3b7999aae9decd1c5e915c756a9be70212f3ea78ac1e9078a8b4b4d92f518e71d015c4335c198fd1857f9a25f2b40539751db11d5010d929
|
7
|
+
data.tar.gz: 5fd1e219ffdc63463ca85a1d1c464027593972433d47a90427b1154de2cab71fcacbac73a100caa63e59de5e01e0c3642a30fb926bcac12c5faa3182b6c43ee8
|
data/lib/tiramizoo.rb
CHANGED
@@ -36,6 +36,26 @@ module Tiramizoo
|
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
|
+
def service_areas
|
40
|
+
response = connection.get({
|
41
|
+
:path => "/api/v1/service_areas",
|
42
|
+
:headers => {"Api-Token" => api_token, "Content-Type" => "application/json"}
|
43
|
+
})
|
44
|
+
|
45
|
+
case response.status
|
46
|
+
when 200
|
47
|
+
JSON.parse(response.body)
|
48
|
+
when 401
|
49
|
+
raise InvalidApiToken
|
50
|
+
when 500
|
51
|
+
raise ServerError
|
52
|
+
when 503
|
53
|
+
raise ServerIsUndergoingMaintenance
|
54
|
+
else
|
55
|
+
raise UnknownError
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
39
59
|
def create_order(sender = {}, recipient = {}, packages = [], time_window = {}, options = {})
|
40
60
|
body = {
|
41
61
|
"pickup" => sender,
|
data/lib/tiramizoo/version.rb
CHANGED