summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2013-08-17 16:19:27 +0900
committerRandy Morgan <[email protected]>2013-08-17 16:19:27 +0900
commitbcaeecc9aee01c6e9f8b801074f18d35c2cc803c (patch)
tree0248f5afde43adf4db476490374748254ae207cb
parent420062b4448bdaafc4e28efa9db22602e413e699 (diff)
downloadcaxlsx-bcaeecc9aee01c6e9f8b801074f18d35c2cc803c.tar.gz
caxlsx-bcaeecc9aee01c6e9f8b801074f18d35c2cc803c.zip
refactored stupidity
-rw-r--r--lib/axlsx/util/serialized_attributes.rb6
1 files changed, 2 insertions, 4 deletions
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