postnord 0.2.2 → 0.2.3

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: 64d4ba6b14b700635c64c2e90aea89dc4d82200d
4
- data.tar.gz: 079dec50d0d9aa8d31157ffcd1bc36dcc6804888
3
+ metadata.gz: 8c5f62dbb4577260e7c50dcaccb1534ff94ff46c
4
+ data.tar.gz: 7b16b9fed310aa9e084d84a2263d8d3bdbe02bb8
5
5
  SHA512:
6
- metadata.gz: 4d42673ba91413f1ea84c75584425f3d3e50cedb71f5e3ab433b3708b94aa34a8218ac82c541ba47a21086f7fab193076962389dcd0ca0ec71519bc3d5d03a2a
7
- data.tar.gz: ebbdc99020299261962388c77b2b8c5d1679f1d677145913b72d8bc24908081da43147ce3c2210921f745394750494b7593d964c1e2ac0a7a0d2e241d1b30a0a
6
+ metadata.gz: d8eba2fb2c46debbb076c8e2ede04ee6f15ec6d170332335660940ba3879e0d856887d6ef7c99b90d2ae228eed76c813a33c77ee164570a55764effe2921d185
7
+ data.tar.gz: 56d61da20c0c8b8ab1f50ee08de53c381e77ca5822d2daf98f049619098430e11a8481817dd27ef1223841b51489a8d15a4df273323d3fbb603fd5c7cfbbdab3
@@ -7,7 +7,7 @@ module Postnord
7
7
  end
8
8
 
9
9
  def code
10
- @data.code
10
+ @data.code
11
11
  end
12
12
 
13
13
  def status
@@ -15,11 +15,9 @@ module Postnord
15
15
  end
16
16
 
17
17
  def data
18
- if @code == "200"
19
- JSON.parse(@data.body)
20
- else
21
- @data.body
22
- end
18
+ JSON.parse(@data.body)
19
+ rescue JSON::ParserError
20
+ @data.body
23
21
  end
24
22
 
25
23
  def to_h
@@ -27,7 +25,7 @@ module Postnord
27
25
  code: @code,
28
26
  status: @status,
29
27
  data: data,
30
- }
28
+ }
31
29
  end
32
30
  end
33
31
  end
@@ -1,3 +1,3 @@
1
1
  module Postnord
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: postnord
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Åhman
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-11-03 00:00:00.000000000 Z
11
+ date: 2016-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler