cognito-client 0.5.1 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c66b88f6616e6681225850d0a0cb7fe3b79efb99
4
- data.tar.gz: 7667ddecc066851b8c7c550cc9e186c0173eec5b
3
+ metadata.gz: 254a261b87f0e6c1632d4ea5dde068bfc048fab4
4
+ data.tar.gz: 82afab80836bce46a4c059ede534a174b46a1d5d
5
5
  SHA512:
6
- metadata.gz: ed5cda472d5e6957ed3cb726a20729685ab5db07459fe6b9ed6e965cc5c6687be032ba5bc0437f27a577a5f610bc8e67f07591dd3d35f7c12795f3b92f221df9
7
- data.tar.gz: 74b03d62cc5df4944f0244dec3663929f3afd01360119c57ee9f3dad589f00f3ac586809a039377dea5675d74cc3bc274a8adcb294af24cfc3796d954f8a0dcf
6
+ metadata.gz: 071d208ecb7dac5f6d34be8f0abf5ad1b6365cd9ccb614108f371e6c8056fbd4fc2b40ea08b5277d2b623b43667e51b2df7550665601c9bd1e28d599ec782a13
7
+ data.tar.gz: d405291bf36e571667b255ba15103ead4878ba53cd32d8afca5a49e8734f31b2c9c09a31da724a167d7c3325292aec010998fc6a47c002ab557a7cf8e845d46f
@@ -1,5 +1,5 @@
1
1
  ---
2
2
  threshold: 12
3
- total_score: 198
3
+ total_score: 214
4
4
  lib_dirs:
5
5
  - lib
@@ -11,7 +11,7 @@ class Cognito
11
11
  ' for resource: %p'
12
12
 
13
13
  def initialize(key, resource)
14
- super(format(MESSAGE, *[key, resource]))
14
+ super(format(MESSAGE, key, resource))
15
15
  end
16
16
  end # MissingRelation
17
17
 
@@ -3,7 +3,7 @@
3
3
  class Cognito
4
4
  class Client
5
5
  class Response
6
- include Anima.new(:status, :headers, :data, :connection)
6
+ include Anima.new(:status, :headers, :data, :json, :connection)
7
7
 
8
8
  def self.build(response, connection)
9
9
  new(Builder.call(response).merge(connection: connection))
@@ -10,7 +10,8 @@ class Cognito
10
10
  {
11
11
  status: build_status,
12
12
  headers: response.headers.to_hash,
13
- data: build_data
13
+ data: build_data,
14
+ json: json_body
14
15
  }
15
16
  end
16
17
 
@@ -22,6 +23,12 @@ class Cognito
22
23
  resource_class.build(document.data, document)
23
24
  end
24
25
 
26
+ def json_body
27
+ return if response.body.empty?
28
+
29
+ JSON.parse(response)
30
+ end
31
+
25
32
  def build_status
26
33
  Status.new(
27
34
  code: response.code,
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  class Cognito
3
- VERSION = '0.5.1'
3
+ VERSION = '0.5.2'
4
4
  end # Cognito
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cognito-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Connor Jacobsen
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2016-10-13 00:00:00.000000000 Z
13
+ date: 2016-10-25 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler