simple-serializer 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/simple-serializer.rb +3 -0
- data/lib/{serializer.rb → simple_serializer.rb} +4 -3
- 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: 670d3babbf2cd6977808f532931b51db54c8cb286042c62c3a3e84a982c7dd76
|
4
|
+
data.tar.gz: 41b3d1d2a63cd2a58eab3d25a72df0dcbc4f1f3c6d8a84f51e542adb17f77b30
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff837e94c46c51afa396c831eb209c5f7ce5ce4920544bb3ed884a85669dd9614375c0def0b9caac37c618645454f3cb751c5869beba9a28d70b2a7ddd8c6621
|
7
|
+
data.tar.gz: ba4bab5946f3a492b4fddd5318df11364dd4f4cdf853411130b145bcbc637a57c5b6afb0452bb68019169aa0c43cf10b8ee8bee602a15c374449d56cb4af636e
|
@@ -1,5 +1,7 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
class SimpleSerializer
|
2
|
-
VERSION = '0.1.
|
4
|
+
VERSION = '0.1.1'
|
3
5
|
|
4
6
|
def initialize(object)
|
5
7
|
@object = object
|
@@ -78,7 +80,7 @@ class SimpleSerializer
|
|
78
80
|
def nest(result)
|
79
81
|
serializable = result.respond_to?(:serializer_class)
|
80
82
|
serializable_array = result.is_a?(Enumerable) &&
|
81
|
-
|
83
|
+
result.first.respond_to?(:serializer_class)
|
82
84
|
|
83
85
|
return result.serializer_class.to_h(result) if serializable
|
84
86
|
return result.first.serializer_class.to_h(result) if serializable_array
|
@@ -86,4 +88,3 @@ class SimpleSerializer
|
|
86
88
|
result
|
87
89
|
end
|
88
90
|
end
|
89
|
-
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple-serializer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mikhail Slyusarev
|
@@ -45,7 +45,8 @@ executables: []
|
|
45
45
|
extensions: []
|
46
46
|
extra_rdoc_files: []
|
47
47
|
files:
|
48
|
-
- lib/serializer.rb
|
48
|
+
- lib/simple-serializer.rb
|
49
|
+
- lib/simple_serializer.rb
|
49
50
|
homepage: https://github.com/mikhailvs/simple-serializer
|
50
51
|
licenses:
|
51
52
|
- MIT
|