tiramizoo 0.1.7 → 0.1.8

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: 49950215ae274aa2ae73a99dd7d3f1a91c360e71
4
- data.tar.gz: d9c4b505a8fa480c0bcd4e6e7865bdaa666bbd4e
3
+ metadata.gz: 375973134789187d51510b03d1dfc99e344d49e4
4
+ data.tar.gz: bb537a90e5cddf70bc4ab9a7d07276f1c1937d54
5
5
  SHA512:
6
- metadata.gz: 15993b6c285eb17dd6a1031e7322b2b965697e4c4c08d535d0bc6db0f105afa5edf7f94e4c4759a72f8c8764f18d7e899cf2a46ce3eef7d8e7ef459ee4b77401
7
- data.tar.gz: fbfffef9a6657791e52e6a08709abe0625e97c8992d678434bdb1838b4786af66495c9fcf82622c736d2b6a1cb74260d5ac5e6f195b0382638a3857d67331369
6
+ metadata.gz: 4d86f629ef46ec8ad34570481ab6deac5b48e64e74751960e3a4fdb549742480dd6cfc5358ae10bcd8c1d96ee314185c6d993ddd75f505a9e3485c31a9180476
7
+ data.tar.gz: b290f8eaad8c745db10219abf97d8dce42a7d74ca43d30d40780fdaaf3d6f3a2a81ce861d7a935a4f8bd8cad11c957641a188f02b4a0059b5aacf7313b860224
@@ -1,3 +1,3 @@
1
1
  module Tiramizoo
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.8"
3
3
  end
data/lib/tiramizoo.rb CHANGED
@@ -16,6 +16,26 @@ module Tiramizoo
16
16
  @connection = Excon.new(ENV['TIRAMIZOO_API_HOST'], debug: Rails.env.development?)
17
17
  end
18
18
 
19
+ def configuration
20
+ response = connection.get({
21
+ :path => "/api/v1/configuration",
22
+ :headers => {"Api-Token" => api_token, "Content-Type" => "application/json"}
23
+ })
24
+
25
+ case response.status
26
+ when 200
27
+ JSON.parse(response.body)
28
+ when 401
29
+ raise InvalidApiToken
30
+ when 500
31
+ raise ServerError
32
+ when 503
33
+ raise ServerIsUndergoingMaintenance
34
+ else
35
+ raise UnknownError
36
+ end
37
+ end
38
+
19
39
  def create_order(sender = {}, recipient = {}, packages = [], time_window = {}, options = {})
20
40
  body = {
21
41
  "pickup" => sender,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tiramizoo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tiramizoo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-02-17 00:00:00.000000000 Z
11
+ date: 2016-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: excon
@@ -87,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
87
  version: '0'
88
88
  requirements: []
89
89
  rubyforge_project:
90
- rubygems_version: 2.4.5.1
90
+ rubygems_version: 2.5.1
91
91
  signing_key:
92
92
  specification_version: 4
93
93
  summary: Tiramizoo API