lib/dm-serializer/to_xml.rb in dm-serializer-1.0.2 vs lib/dm-serializer/to_xml.rb in dm-serializer-1.1.0.rc1
- old
+ new
@@ -27,10 +27,10 @@
value = __send__(property.name)
attrs = (property.primitive == String) ? {} : {'type' => property.primitive.to_s.downcase}
xml.add_node(root, property.name.to_s, value, attrs)
end
- (opts[:methods] || []).each do |meth|
+ Array(opts[:methods]).each do |meth|
if self.respond_to?(meth)
xml_name = meth.to_s.gsub(/[^a-z0-9_]/, '')
value = __send__(meth)
unless value.nil?
if value.respond_to?(:to_xml_document)