ializer 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ializer/version.rb +1 -1
- data/lib/ser/ializer.rb +4 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '086b2c8ab6cf0a932aa88a21336a776acc21df97cf2bfebba2d0c88bb7c9c0ac'
|
4
|
+
data.tar.gz: 740fd2f601120118916917fed867b3427ec9707835450221b81758d47bade5cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 86005ca1dbe5ad262ecd4a0347406a39e2ce305806991efc122390021683541504120c37b740515459f89cc17b9dde63aceb4149f355ce998da4546b87140fb5
|
7
|
+
data.tar.gz: c41e6d19fc25aa1f1704a51219d4a036d0df8579c6893024e1c6714b43c61c7da23580f2e487e720ac3cfd8aaca6511629bc4ecccb563bb720f0c50f00635b0e
|
data/lib/ializer/version.rb
CHANGED
data/lib/ser/ializer.rb
CHANGED
@@ -38,6 +38,8 @@ module Ser
|
|
38
38
|
def serialize(object, context = nil)
|
39
39
|
return serialize_one(object, context) unless valid_enumerable?(object)
|
40
40
|
|
41
|
+
return [] if object.empty?
|
42
|
+
|
41
43
|
object.map { |o| serialize_one(o, context) }
|
42
44
|
end
|
43
45
|
|
@@ -129,6 +131,8 @@ module Ser
|
|
129
131
|
|
130
132
|
return field.serialize(value, context) unless valid_enumerable?(value)
|
131
133
|
|
134
|
+
return nil if value.empty?
|
135
|
+
|
132
136
|
value.map { |v| field.serialize(v, context) }
|
133
137
|
end
|
134
138
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ializer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Steinberg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-02-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|