wrappi 0.2.4 → 0.2.5

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
  SHA256:
3
- metadata.gz: 6b03e938b92d159fc98e69873c1c1ca4a5a26ddd9c44867109311421100d981b
4
- data.tar.gz: e6aa982e2956cbaef78d4e25db2a341ada0d28a4cdbce08bf5e5d661ffa9be29
3
+ metadata.gz: cdf93a36321552af49d6edd7b1e613f36d8294098e3702a3182adfca15dc664d
4
+ data.tar.gz: 5c3ebb3d3507c5fc11ed7404a1f631fadc6a401c22828cffd0573b09c1f694ad
5
5
  SHA512:
6
- metadata.gz: edd52700c58b67a461c8d7652ebd01d4d471feff4e6bbba873c0cba9e4b6f485b4b55b2e1638f5ed5ea9ead082248bdb8ff8f542e76411d62a9831fd22fb62fe
7
- data.tar.gz: 396cd19b742ad2d2df71629afb01ab5796607dd999606701e9bb36830cd4b17fe3d636692350ae916953c610de5ca5f15782879e7ea5ace9910f79195231af89
6
+ metadata.gz: 42e98a0e070fa90e2eff25dcf2731630a8e1f9583f4a7a834ce56f71e78044ee22af1c1d9fbd4df7ed1a9de99337108b7257b36eb7a0714c8662e85d80970e17
7
+ data.tar.gz: 13190e49c3a13054c473e7e2e345f26ba5602b35a679d0a70831c8359ca75fddfd3a31372266f89afb03e5ca7e9f76e9d95d3dbe4e8965baf932d1298012fec1
@@ -20,7 +20,7 @@ module Wrappi
20
20
  end
21
21
 
22
22
  def body
23
- @body ||= request.parse
23
+ @body ||= parse
24
24
  end
25
25
 
26
26
  def success?
@@ -53,6 +53,18 @@ module Wrappi
53
53
  }
54
54
  end
55
55
 
56
+ def parse
57
+ request.parse
58
+ rescue
59
+ json_parse
60
+ end
61
+
62
+ def json_parse
63
+ JSON.parse(raw_body)
64
+ rescue
65
+ raw_body
66
+ end
67
+
56
68
  def method_missing(method_name, *arguments, &block)
57
69
  if request.respond_to?(method_name)
58
70
  request.send(method_name, *arguments, &block)
@@ -1,3 +1,3 @@
1
1
  module Wrappi
2
- VERSION = "0.2.4"
2
+ VERSION = "0.2.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wrappi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Artur Pañach
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-06-04 00:00:00.000000000 Z
11
+ date: 2019-06-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler