dxlite 0.2.2 → 0.2.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
  SHA256:
3
- metadata.gz: bf76970719d297956cab4003755b984e7b7849a9f0f8dbc61c7e99ce20ca96d8
4
- data.tar.gz: acd9d7cd693d355134ca1c33863203f8991cc3b42b988ae91e4449c8d6174a82
3
+ metadata.gz: 6268d88624bc2c37694a40bcd196ef5653e67ee4f49c2e3aa57762e0c24eaf74
4
+ data.tar.gz: ff5277f2debc53311cc5b4d59eebb04d568199ff28df0e77bf4a731ddc89408d
5
5
  SHA512:
6
- metadata.gz: 11fba990077d4ae039878410b876a0d61d8a57c9dfe40333b68ce5b50ad0d4e88b698b3d33711d9a899807cf3194a6e29b6d08aff8c53f2cfae7bf5dbfab6b67
7
- data.tar.gz: 32142c4b0ec6ef0db19daa9f807b6723b5087aac6665abbb7979a4c39e05ff196691a745fcd439c57d780e45d2edf3e1dd54b8db1a3d2629570896df21997107
6
+ metadata.gz: 4b639ab519450eee10073783acdcf0ed5c6cdf3013c54fb5251e06dc30f85147629d90572de01e322861e16443542e26f124390f3616b47c327191aafbed78da
7
+ data.tar.gz: 36fc53ce6d3bb42ee0c07bd072b19cd83a61a72445b63f3c8b8de98dd20dc061cca69e71e1987ae0ead27d23286a901e719807f473b9e0b8bb25795deec647a1
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -118,6 +118,23 @@ class DxLite
118
118
 
119
119
  alias to_a records
120
120
 
121
+ def to_xml()
122
+
123
+ root_name = schema()[/^\w+/]
124
+ record_name = schema()[/(?<=\/)[^\(]+/]
125
+
126
+ h = {
127
+ root_name.to_sym =>
128
+ {
129
+ summary: @summary,
130
+ records: @records.map {|h| {record_name.to_sym => h} }
131
+ }
132
+ }
133
+
134
+ Rexle.new(RexleBuilder.new(h, debug: false).to_a).xml pretty: true
135
+
136
+ end
137
+
121
138
  # Updates a record from an id and a hash containing field name and field value.
122
139
  # dynarex.update 4, name: Jeff, age: 38
123
140
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dxlite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
Binary file