simply_serializable 1.0.0 → 1.1.0
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/.byebug_history +6 -0
- data/Gemfile.lock +1 -1
- data/lib/simply_serializable/mixin.rb +10 -4
- data/lib/simply_serializable/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd5e5fe82b38894f4b90439928e4de8383e8f4fac49bb152d966dd6f0f309cd2
|
4
|
+
data.tar.gz: 258bebc2ed9a8a676ca6bf2c847360f9655a61de660cea0b08011cddfc82d3d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 40aade8c05d4e355e7fdf59ccdae2848d6a4cbddf9bcabc895669ca72e288a6f69d4006014b924c9d4b92912eb53989815c72e092ec83978f49338d39e7373d3
|
7
|
+
data.tar.gz: 9b280e7b8cf8694035eff62d5994c2535523963110bce882c08feb6447c0b542f1aa2e32c5d3f1571bea3382d90b3fb9fb45e77e3017dcaa23298f500e31ed74
|
data/.byebug_history
CHANGED
data/Gemfile.lock
CHANGED
@@ -8,12 +8,18 @@ module SimplySerializable
|
|
8
8
|
super(subclass)
|
9
9
|
end
|
10
10
|
|
11
|
-
def serialize(
|
12
|
-
|
11
|
+
def serialize(attributes: [], except: [], only: [])
|
12
|
+
serializable_config[:attributes] = serializable_config[:attributes] |= attributes
|
13
|
+
serializable_config[:except] = serializable_config[:except] |= except
|
14
|
+
serializable_config[:only] = serializable_config[:only] |= only
|
13
15
|
end
|
14
16
|
|
15
17
|
def serializable_config
|
16
|
-
@serializable_config ||= {
|
18
|
+
@serializable_config ||= {
|
19
|
+
attributes: [],
|
20
|
+
except: [],
|
21
|
+
only: []
|
22
|
+
}
|
17
23
|
end
|
18
24
|
end
|
19
25
|
|
@@ -28,7 +34,7 @@ module SimplySerializable
|
|
28
34
|
|
29
35
|
def serializer(cache: {})
|
30
36
|
Serializer.new(
|
31
|
-
self.class.serializable_config.merge(
|
37
|
+
**self.class.serializable_config.merge(
|
32
38
|
cache: cache,
|
33
39
|
object: self
|
34
40
|
)
|