dynarex 0.9.12 → 1.0.0

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.
Files changed (2) hide show
  1. data/lib/dynarex.rb +16 -6
  2. metadata +2 -2
@@ -27,6 +27,9 @@ class Dynarex
27
27
 
28
28
  def add(x)
29
29
  @doc.add x
30
+ puts 'docccc : ' + @doc.xml
31
+ load_records
32
+ self
30
33
  end
31
34
 
32
35
  def delimiter=(separator)
@@ -163,8 +166,9 @@ EOF
163
166
  end
164
167
 
165
168
  h.each {|key, item| h.delete(key) if not h2.has_key? key}
166
- refresh_doc
169
+ #refresh_doc
167
170
  #load_records
171
+ rebuild_doc
168
172
  self
169
173
  end
170
174
 
@@ -288,6 +292,11 @@ EOF
288
292
 
289
293
  def display_xml
290
294
 
295
+ @doc.xml pretty: true
296
+ end
297
+
298
+ def rebuild_doc
299
+
291
300
  xml = Builder::XmlMarkup.new( :target => buffer='', :indent => 2 )
292
301
  xml.instruct! :xml, :version => "1.0", :encoding => "UTF-8"
293
302
 
@@ -295,20 +304,21 @@ EOF
295
304
  xml.summary do
296
305
  @summary.each{|key,value| xml.send key, value}
297
306
  end
298
- xml.records do
299
- if @records then
307
+ if @records then
308
+ xml.records do
309
+
300
310
  @records.each do |k, item|
301
311
  xml.send(@record_name, id: item[:id], created: item[:created], \
302
312
  last_modified: item[:last_modified]) do
303
313
  item[:body].each{|name,value| xml.send name, value}
304
314
  end
305
315
  end
316
+
306
317
  end
307
- end
318
+ end # end of if @records
308
319
  end
309
320
 
310
321
  @doc = Rexle.new buffer
311
- buffer
312
322
 
313
323
  end
314
324
 
@@ -443,4 +453,4 @@ end))
443
453
  end
444
454
  end
445
455
 
446
- end
456
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dynarex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.12
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors: []
7
7
 
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2011-01-03 00:00:00 +00:00
12
+ date: 2011-01-04 00:00:00 +00:00
13
13
  default_executable:
14
14
  dependencies: []
15
15