serega 0.1.3 → 0.1.4
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/VERSION +1 -1
- data/lib/serega/plugins/context_metadata/context_metadata.rb +6 -10
- 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: ad827e730d35f4e1805b7a0c59e8a8eeec87a91bb426ada370ea4a632516f40c
|
4
|
+
data.tar.gz: 681deb3a954453740ac3256614684601aeb18027423352ca05cc62c82ff37784
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f279fecc4038a162b33d97001fa993758eb4d687c0a7b83f9555f20781e3ece12b1381ba9765993cf5a4d7a31a5dee66f29d3279e1198a6ddf6b6d19b977682
|
7
|
+
data.tar.gz: c1ed8f5f7e06ff2df08f2f5fb8ee587d062e3197399475c55d1383ab0fcb6c4c8f5224363ef202ecccdab063964a9e5cf98581ecdacfa5ac5caafa02277c93c6
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.4
|
@@ -14,8 +14,8 @@ class Serega
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def self.load_plugin(serializer_class, **_opts)
|
17
|
-
serializer_class.include(InstanceMethods)
|
18
17
|
serializer_class::Convert.include(ConvertInstanceMethods)
|
18
|
+
serializer_class::CheckSerializeParams.extend(CheckSerializeParamsClassMethods)
|
19
19
|
end
|
20
20
|
|
21
21
|
def self.after_load_plugin(serializer_class, **opts)
|
@@ -25,16 +25,12 @@ class Serega
|
|
25
25
|
config[:serialize_keys] << meta_key
|
26
26
|
end
|
27
27
|
|
28
|
-
module
|
29
|
-
def
|
30
|
-
meta_key = self.class.config[:context_metadata][:key]
|
31
|
-
meta = opts[meta_key]
|
32
|
-
|
33
|
-
if meta && !meta.is_a?(Hash)
|
34
|
-
raise Serega::Error, "Option :#{meta_key} must be a Hash, but #{meta.class} was given"
|
35
|
-
end
|
36
|
-
|
28
|
+
module CheckSerializeParamsClassMethods
|
29
|
+
def check_opts(opts)
|
37
30
|
super
|
31
|
+
|
32
|
+
meta_key = serializer_class.config[:context_metadata][:key]
|
33
|
+
Validations::Utils::CheckOptIsHash.call(opts, meta_key)
|
38
34
|
end
|
39
35
|
end
|
40
36
|
|