enveloop 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -1
- data/Gemfile.lock +2 -2
- data/lib/enveloop/client.rb +3 -1
- data/lib/enveloop/response.rb +24 -0
- data/lib/enveloop/version.rb +1 -1
- data/lib/enveloop.rb +2 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1af89bdd26c1380d6f05ebf9b9ab9e86c29617eeb689760c88dd81f7009397cd
|
4
|
+
data.tar.gz: 51c5c8a2ffc6e557e469b14a5dac3b1b04628c484525189598a893c55de7630f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3048366a973c5115ac2e9c5dafae487441c62d4f43d6106dc9886f3dbca336d41870195f25d15bdb5f4fc3811bd47ad49d2fa40face26866921f01e6b0b830ca
|
7
|
+
data.tar.gz: de31f9fb4c68cab0c0773e4e1a192a1fc9ff64904254f4e5468c35addbd1f94d419f44792448bd1781831e385f17ad1c9832e6bc5ed5216b26f85c95964498a9
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
enveloop (0.1.
|
4
|
+
enveloop (0.1.1)
|
5
5
|
faraday
|
6
6
|
|
7
7
|
GEM
|
@@ -26,7 +26,7 @@ GEM
|
|
26
26
|
diff-lcs (>= 1.2.0, < 2.0)
|
27
27
|
rspec-support (~> 3.10.0)
|
28
28
|
rspec-support (3.10.2)
|
29
|
-
ruby2_keywords (0.0.
|
29
|
+
ruby2_keywords (0.0.4)
|
30
30
|
|
31
31
|
PLATFORMS
|
32
32
|
ruby
|
data/lib/enveloop/client.rb
CHANGED
@@ -21,9 +21,11 @@ module Enveloop
|
|
21
21
|
}
|
22
22
|
)
|
23
23
|
|
24
|
-
conn.post("/templates/#{template}") do |req|
|
24
|
+
response = conn.post("/templates/#{template}") do |req|
|
25
25
|
req.body = data.to_json
|
26
26
|
end
|
27
|
+
|
28
|
+
return Response.new(status: response.status, body: response.body)
|
27
29
|
end
|
28
30
|
end
|
29
31
|
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Enveloop
|
2
|
+
class Response
|
3
|
+
attr_reader :status, :message, :error
|
4
|
+
|
5
|
+
def initialize(status: 200, body: nil)
|
6
|
+
@status = status
|
7
|
+
|
8
|
+
if status == 200
|
9
|
+
@message = JSON.parse(body)
|
10
|
+
@error = nil
|
11
|
+
elsif status == 500
|
12
|
+
@message = nil
|
13
|
+
@error = JSON.parse(body)['error']
|
14
|
+
else
|
15
|
+
@message = nil
|
16
|
+
@error = 'Unknown error'
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def success?
|
21
|
+
@status == 200
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
data/lib/enveloop/version.rb
CHANGED
data/lib/enveloop.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: enveloop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Wyrosdick
|
@@ -45,6 +45,7 @@ files:
|
|
45
45
|
- enveloop.gemspec
|
46
46
|
- lib/enveloop.rb
|
47
47
|
- lib/enveloop/client.rb
|
48
|
+
- lib/enveloop/response.rb
|
48
49
|
- lib/enveloop/version.rb
|
49
50
|
homepage: https://github.com/enveloophq/ruby_enveloop
|
50
51
|
licenses:
|
@@ -68,7 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
68
69
|
- !ruby/object:Gem::Version
|
69
70
|
version: '0'
|
70
71
|
requirements: []
|
71
|
-
rubygems_version: 3.1.
|
72
|
+
rubygems_version: 3.1.4
|
72
73
|
signing_key:
|
73
74
|
specification_version: 4
|
74
75
|
summary: Envelope API wrapper
|