panko_serializer 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 +4 -4
- data/lib/panko/association.rb +17 -0
- data/lib/panko/serialization_descriptor.rb +3 -3
- data/lib/panko/version.rb +1 -1
- data/lib/panko_serializer.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a6b6564ceb0042f812b605b237ac6b5311a320d2cf44445f34276c1747b6609c
|
|
4
|
+
data.tar.gz: 9a52ca30b949c72abf36f8e7dbd891d196fbdb8cebd4fd569155fa55eb0d6263
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 80bb72b9a46ad8bc30de021ac32b3167d3c2659f7dd37d06d3a60935ad3e9c3bc2538ab92497dd8bf834e74f76890be77aab18bc4a01afa7a79a634881e7e442
|
|
7
|
+
data.tar.gz: 84330bd443f13277650d64444fb0270542eddf77cd559142a8ca10feb33d646049ac0f9b024072f403de7bb7878a2321ee2b6cc4948420f4e11654a3def31a65
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Panko
|
|
4
|
+
class Association
|
|
5
|
+
def duplicate
|
|
6
|
+
Panko::Association.new(
|
|
7
|
+
name_sym,
|
|
8
|
+
name_str,
|
|
9
|
+
Panko::SerializationDescriptor.duplicate(descriptor)
|
|
10
|
+
)
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def inspect
|
|
14
|
+
"<Panko::Attribute name=#{name_str.inspect}>"
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -30,10 +30,10 @@ module Panko
|
|
|
30
30
|
backend.attributes = descriptor.attributes.dup
|
|
31
31
|
|
|
32
32
|
backend.method_fields = descriptor.method_fields.dup
|
|
33
|
-
backend.serializer = descriptor.type.new(_skip_init: true)
|
|
33
|
+
backend.serializer = descriptor.type.new(_skip_init: true) unless backend.method_fields.empty?
|
|
34
34
|
|
|
35
|
-
backend.has_many_associations = descriptor.has_many_associations.
|
|
36
|
-
backend.has_one_associations = descriptor.has_one_associations.
|
|
35
|
+
backend.has_many_associations = descriptor.has_many_associations.map(&:duplicate)
|
|
36
|
+
backend.has_one_associations = descriptor.has_one_associations.map(&:duplicate)
|
|
37
37
|
|
|
38
38
|
backend
|
|
39
39
|
end
|
data/lib/panko/version.rb
CHANGED
data/lib/panko_serializer.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: panko_serializer
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.5.
|
|
4
|
+
version: 0.5.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Yosi Attias
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-08-
|
|
11
|
+
date: 2018-08-25 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: oj
|
|
@@ -88,6 +88,7 @@ files:
|
|
|
88
88
|
- ext/panko_serializer/serialization_descriptor/serialization_descriptor.c
|
|
89
89
|
- ext/panko_serializer/serialization_descriptor/serialization_descriptor.h
|
|
90
90
|
- lib/panko/array_serializer.rb
|
|
91
|
+
- lib/panko/association.rb
|
|
91
92
|
- lib/panko/attribute.rb
|
|
92
93
|
- lib/panko/response.rb
|
|
93
94
|
- lib/panko/serialization_descriptor.rb
|