xmlmapper 0.6.2 → 0.6.3

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: ff5913ddcbb7bd218e51eecf4e95d55adb3a6732
4
- data.tar.gz: 4dbfabb63c5aec4d20c70e8ee9b53b3c62ec937a
3
+ metadata.gz: 3a3c14f5e8ceec06b9800e8fbb00d0bd29ca058e
4
+ data.tar.gz: 7cff1951dc92161e4135523e3ac72624bb965152
5
5
  SHA512:
6
- metadata.gz: 613d7894bdb569918065c880db696f04609e418e291758144048b76da9a9506e0dffa2679565b4b28c1220dbcf6d0b211153f2fb55fab803c65868a7b6b89ce4
7
- data.tar.gz: 02aadefa211022eba3a410a7f40744ef27864dba8df2301e468e54cc4086d93302229212e1abe4bc8773d601af5e9923f8466ed89b4a0335fa8525870b9a9c03
6
+ metadata.gz: 86aad8f4b953a940f1ffdcd5b63bda9017d63643c67a3e294493f992e5543c51411646497a21762f6e894a4ffb5e46dcbc00c8ab6119e84ef17b71d71dac8510
7
+ data.tar.gz: 54aff22c419781eef9dcf5278162b99b83dada707e736fb2de9e0d45ec581a8b648ee02fbf5146f0dee666c237f596c71fb445aa2d806f9cbe543816eaa8973b
data/lib/xmlmapper.rb CHANGED
@@ -435,7 +435,7 @@ module XmlMapper
435
435
  # assign the current xml that we just parsed to the xml_value
436
436
 
437
437
  if obj.respond_to?('xml_value=')
438
- n.namespaces.each {|name,path| n[name] = path }
438
+ # n.namespaces.each {|name,path| n[name] = path }
439
439
  obj.xml_value = n.to_xml(save_with: Nokogiri::XML::Node::SaveOptions::AS_XML | Nokogiri::XML::Node::SaveOptions::NO_DECLARATION)
440
440
  end
441
441
 
@@ -497,6 +497,10 @@ module XmlMapper
497
497
  end
498
498
  end
499
499
 
500
+ def registered_namespaces
501
+ @registered_namespaces ||= self.class.instance_variable_get('@registered_namespaces').dup
502
+ end
503
+
500
504
  #
501
505
  # Create an xml representation of the specified class based on defined
502
506
  # XmlMapper elements and attributes. The method is defined in a way
@@ -597,8 +601,8 @@ module XmlMapper
597
601
  # However, we do not want to add the namespace if the namespace is 'xmlns'
598
602
  # which means that it is the default namesapce of the code.
599
603
  #
600
- if self.class.instance_variable_get('@registered_namespaces') && builder.doc.root
601
- self.class.instance_variable_get('@registered_namespaces').each_pair do |name,href|
604
+ if registered_namespaces && builder.doc.root
605
+ registered_namespaces.each_pair do |name,href|
602
606
  name = nil if name == "xmlns"
603
607
  builder.doc.root.add_namespace(name,href)
604
608
  end
@@ -1,3 +1,3 @@
1
1
  module XmlMapper
2
- VERSION = "0.6.2"
2
+ VERSION = "0.6.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xmlmapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Damien Le Berrigaud