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 +4 -4
- data/lib/tiramizoo/version.rb +1 -1
- data/lib/tiramizoo.rb +20 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 375973134789187d51510b03d1dfc99e344d49e4
|
4
|
+
data.tar.gz: bb537a90e5cddf70bc4ab9a7d07276f1c1937d54
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d86f629ef46ec8ad34570481ab6deac5b48e64e74751960e3a4fdb549742480dd6cfc5358ae10bcd8c1d96ee314185c6d993ddd75f505a9e3485c31a9180476
|
7
|
+
data.tar.gz: b290f8eaad8c745db10219abf97d8dce42a7d74ca43d30d40780fdaaf3d6f3a2a81ce861d7a935a4f8bd8cad11c957641a188f02b4a0059b5aacf7313b860224
|
data/lib/tiramizoo/version.rb
CHANGED
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.
|
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-
|
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.
|
90
|
+
rubygems_version: 2.5.1
|
91
91
|
signing_key:
|
92
92
|
specification_version: 4
|
93
93
|
summary: Tiramizoo API
|