From bcaeecc9aee01c6e9f8b801074f18d35c2cc803c Mon Sep 17 00:00:00 2001 From: Randy Morgan Date: Sat, 17 Aug 2013 16:19:27 +0900 Subject: refactored stupidity --- lib/axlsx/util/serialized_attributes.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/axlsx/util/serialized_attributes.rb b/lib/axlsx/util/serialized_attributes.rb index 76ec7e41..d38afe78 100644 --- a/lib/axlsx/util/serialized_attributes.rb +++ b/lib/axlsx/util/serialized_attributes.rb @@ -48,11 +48,9 @@ module Axlsx end def declared_attributes - declared = instance_values - declared.each do |key, value| - declared.delete(key) if value == nil || !self.class.xml_attributes.include?(key.to_sym) + instance_values.select do |key, value| + value != nil && self.class.xml_attributes.include?(key.to_sym) end - declared end # serialized instance values at text nodes on a camelized element of the -- cgit v1.2.3