roundtrip_xml 1.1.1 → 1.1.2

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: bec50a6f72fa1401f816ff1b8c1598aabba35c20
4
- data.tar.gz: 416654af98b1fb5dda857586f0fc890b3bceb9f5
3
+ metadata.gz: 5cda702d22e8cf03016169b104a5b8687b1da663
4
+ data.tar.gz: 853ebd2749fdd86624679a7ab30d98ea9604fae6
5
5
  SHA512:
6
- metadata.gz: ab05c3b695450b7064225a2506b4c2ea6c7f754665469143f7062c534e246b980bbe915059e9a1f83853cc8bdab23c08511c5414cb41ae6062d922425c313ff1
7
- data.tar.gz: 1e66cd0d3bb3670aac96c612106bc00e34efcd5dcf13380812aae4b7bba828fca5487771dbf69799902c3fb39558b6e072227b16dfe69a1089955ca9259ed3a6
6
+ metadata.gz: 1010cadb98e7a674986bfea894cd0572118730615b97fc9f9f4709cb78549cb38e60329a4e1dc0652e09e26ddc098b0e7d99ce89435050aa603a78b258767e34
7
+ data.tar.gz: 75de98c6f8c81437de9192eba639244411ab516571b65b742783908b0c058d398575f87beda95d605228d0fd5852138e62c5c2330cb313eadcb4bae5f658ae0b
@@ -34,12 +34,21 @@ EOF
34
34
  def initialize(roxml_obj, runtime)
35
35
  @roxml_obj = roxml_obj
36
36
  self.runtime = runtime
37
+ @parser = RubyParser.new
38
+ end
39
+
40
+ def create_hash_sexp(hash)
41
+ @parser.process(hash.to_s).to_a
37
42
  end
38
43
 
39
44
  def create_sexp_for_roxml_obj(obj, root_method = nil)
40
45
  is_subclass = obj.class.subclass?
41
46
  subclass_value = is_subclass ? [:lit, obj.class.class_name] : nil
42
47
  accessors = []
48
+ # metadata
49
+ if root_method && obj._metadata && !obj._metadata.empty?
50
+ accessors << [:call, nil, :_metadata, create_hash_sexp(obj._metadata)]
51
+ end
43
52
  obj.attributes.each do |attr|
44
53
  val = obj.send attr.accessor
45
54
  next unless val
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roundtrip_xml
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Usick