siren_client 1.0.1 → 1.0.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 +4 -4
- data/lib/siren_client/action.rb +2 -2
- data/lib/siren_client/version.rb +1 -1
- data/siren_client.gemspec +1 -0
- data/spec/unit/action_spec.rb +3 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 13597c24336544ff66447685a66b56401007139b
|
|
4
|
+
data.tar.gz: d869e2b3cdd58f757b86c9d9640d4d92793c112c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8538d6ad51a9d96656ae56795882d0a9b26437b9544f27a904417ef13a8b2b145d53352e628037e517fea3c3605d5af175a6935c5a92dc0c57cf5461ec709abf
|
|
7
|
+
data.tar.gz: 73354606446450340f721d97cf894c6055892431df2a13028f55b7be501c8828887ea8f1ef5840ce0b4f20492132bba3c6f4895ef7bb8342b130c4e7df87226e
|
data/lib/siren_client/action.rb
CHANGED
|
@@ -14,12 +14,12 @@ module SirenClient
|
|
|
14
14
|
|
|
15
15
|
@config = { format: :json }.merge config
|
|
16
16
|
@name = @payload['name'] || ''
|
|
17
|
-
@classes = @payload['class'] || []
|
|
17
|
+
@classes = (@payload['class'] || []).clone
|
|
18
18
|
@method = (@payload['method'] || 'GET').downcase
|
|
19
19
|
@href = @payload['href'] || ''
|
|
20
20
|
@title = @payload['title'] || ''
|
|
21
21
|
@type = @payload['type'] || 'application/x-www-form-urlencoded'
|
|
22
|
-
@fields = @payload['fields'] || []
|
|
22
|
+
@fields = (@payload['fields'] || []).clone
|
|
23
23
|
@fields.map! do |field_data|
|
|
24
24
|
SirenClient::Field.new(field_data)
|
|
25
25
|
end
|
data/lib/siren_client/version.rb
CHANGED
data/siren_client.gemspec
CHANGED
data/spec/unit/action_spec.rb
CHANGED
|
@@ -37,6 +37,9 @@ describe SirenClient::Action do
|
|
|
37
37
|
it 'is a hash' do
|
|
38
38
|
expect(action.payload).to be_a Hash
|
|
39
39
|
end
|
|
40
|
+
it 'is NOT overwritten with SirenClient::Field classes' do
|
|
41
|
+
expect(action.payload['fields'][0]).to be_a Hash
|
|
42
|
+
end
|
|
40
43
|
end
|
|
41
44
|
describe '.name' do
|
|
42
45
|
it 'is a string' do
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: siren_client
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Chason Choate
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-
|
|
11
|
+
date: 2016-09-05 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: httparty
|