attribute_struct 0.2.18 → 0.2.20

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 296a50061afc99819ed64be8d8c061764919143a
4
- data.tar.gz: 653c84658406cad94a334e899678cf4c2ed211a1
3
+ metadata.gz: d48c85e42d6879e924f24f40bada06f9f1b6c1b0
4
+ data.tar.gz: 6f41e2b3229b0229f9edc53943e23c6e086453b2
5
5
  SHA512:
6
- metadata.gz: 2748e3dce1d87b3d984b0573802fa13f02314c448cb88e7f817e4c935f630e30ef4c4ca00d86fa439396aaeb84f319e34897b763ec15ebd0acfe1eb0e41b01f8
7
- data.tar.gz: 056717b9c002ae84792f691443b4cf7d1ff2cd5d55fa62957f1ecaa28661ca0c5736d1552395d856ba9c0e57c95196ec376b8b4bd3d43b520fa68bdec18c304e
6
+ metadata.gz: f84ee43890fd47d888a3df06d1f6009de2a5b684af3dc9743207534372c5c781c21d9037db87f52f1571130a24d08e950e4427e9d034510c26ec78d8d086329a
7
+ data.tar.gz: 16e3b57dc6f98c57e4b73da3c0e94323a19c0cc1141d60bb79900b26ce7a1ab9beae5ef6019c3f47ad57590424e0a50599762ef85296a98d0e3f6d81c28c2f79
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## v0.2.20
2
+ * Fix: remove nil structs
3
+
1
4
  ## v0.2.18
2
5
  * Fix `AttributeStruct#dump!` to properly handle nil-type values
3
6
 
@@ -273,13 +273,15 @@ class AttributeStruct < BasicObject
273
273
  v.is_a?(_klass) ? v._dump : v
274
274
  end
275
275
  val = value.is_a?(::Hash) ? __hashish[*flat.flatten(1)] : flat
276
+ elsif(value.is_a?(_klass) && value.nil?)
277
+ next
276
278
  elsif(value.is_a?(_klass) && !value.nil?)
277
279
  val = value._dump
278
280
  else
279
281
  val = value.nil? ? nil : value
280
282
  end
281
283
  [key, val]
282
- end
284
+ end.compact
283
285
  __hashish[*processed.flatten(1)]
284
286
  end
285
287
  alias_method :dump!, :_dump
@@ -2,5 +2,5 @@ require 'attribute_struct/attribute_struct'
2
2
 
3
3
  class AttributeStruct
4
4
  # Current library version
5
- VERSION = ::Gem::Version.new('0.2.18')
5
+ VERSION = ::Gem::Version.new('0.2.20')
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: attribute_struct
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.18
4
+ version: 0.2.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Roberts
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-08 00:00:00.000000000 Z
11
+ date: 2015-06-10 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Attribute structures
14
14
  email: chrisroberts.code@gmail.com