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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 375973134789187d51510b03d1dfc99e344d49e4
4
- data.tar.gz: bb537a90e5cddf70bc4ab9a7d07276f1c1937d54
3
+ metadata.gz: c5e938e60cc50b2644d5cdd7201e72a7052b2ef1
4
+ data.tar.gz: bfe12e64de2a541dab8235f74f70d330aec0e1fe
5
5
  SHA512:
6
- metadata.gz: 4d86f629ef46ec8ad34570481ab6deac5b48e64e74751960e3a4fdb549742480dd6cfc5358ae10bcd8c1d96ee314185c6d993ddd75f505a9e3485c31a9180476
7
- data.tar.gz: b290f8eaad8c745db10219abf97d8dce42a7d74ca43d30d40780fdaaf3d6f3a2a81ce861d7a935a4f8bd8cad11c957641a188f02b4a0059b5aacf7313b860224
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,
@@ -1,3 +1,3 @@
1
1
  module Tiramizoo
2
- VERSION = "0.1.8"
2
+ VERSION = "0.1.9"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tiramizoo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tiramizoo