diff options
Diffstat (limited to 'lib/axlsx/util/serialized_attributes.rb')
| -rw-r--r-- | lib/axlsx/util/serialized_attributes.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/axlsx/util/serialized_attributes.rb b/lib/axlsx/util/serialized_attributes.rb index d6b5d3c7..5dcb77fc 100644 --- a/lib/axlsx/util/serialized_attributes.rb +++ b/lib/axlsx/util/serialized_attributes.rb @@ -61,7 +61,7 @@ module Axlsx # seraialized_attributes and are not nil. # This requires ruby 1.9.3 or higher def declared_attributes - instance_values.select do |key, value| + Axlsx.instance_values(self).select do |key, value| value != nil && self.class.xml_attributes.include?(key.to_sym) end end @@ -75,7 +75,7 @@ module Axlsx # @return [String] The serialized output. def serialized_element_attributes(str='', additional_attributes=[], &block) attrs = self.class.xml_element_attributes + additional_attributes - values = instance_values + values = Axlsx.instance_values(self) attrs.each do |attribute_name| value = values[attribute_name.to_s] next if value.nil? |
