scoped_serializer 1.0.1 → 1.0.2

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: 68d1d14432e7ba33ed7f794ee9a9d37a74404e43
4
- data.tar.gz: f26d981f83d3028c879021e93fbe3083da6fa4ce
3
+ metadata.gz: 15e358c712160fea2d887dfaae7c4e65ee406fde
4
+ data.tar.gz: 3527182be7af9dcd647ce89e2e1c80be3e304bce
5
5
  SHA512:
6
- metadata.gz: e9822c56d6644e6975872262f69bf1cd9d14a7b86b93ac93dedbe258cdc44cd1793ff31d28bd0573befaf23683f40d8871356c07bf50b1e8bb3b074558e7009e
7
- data.tar.gz: de934c5af2199e936bf0e58868530f26543d41122d8b1ef5f2590342e8fc0eff4e047aac2975b37fc5ade48354d0ec18fc1e179cd9207469b53c4acb1efcee68
6
+ metadata.gz: 70209dd855839e6e5e9ee42af7d8d38ffdd5d62e1ca9d7d798771451058c186115d15bc77a56f74fed416de824b6f9a96f9c93599447766eda742d2c1b8bb677
7
+ data.tar.gz: 36805def7e73a315630b86444b8e7a22fb3d69e9fcbf75bc09e898abc35ffffa7deba0bae0b87f8e1ca94d2d370550e78f0594b5f3c7ef7aa60c4f3eb060c3d6
@@ -44,12 +44,16 @@ module ScopedSerializer
44
44
  options = @options.merge(options)
45
45
 
46
46
  if options[:root]
47
- { options[:root].to_sym => serializable_hash }.merge(meta_hash)
47
+ { options[:root].to_sym => serializable_hash }.merge(meta_hash).merge(data_hash)
48
48
  else
49
49
  serializable_hash
50
50
  end
51
51
  end
52
52
 
53
+ def data_hash
54
+ @options[:data] || {}
55
+ end
56
+
53
57
  def meta_hash
54
58
  if meta.present?
55
59
  { :meta => meta }
@@ -1,3 +1,3 @@
1
1
  module ScopedSerializer
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scoped_serializer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arjen Oosterkamp
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-11 00:00:00.000000000 Z
11
+ date: 2017-11-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails