dynarex 1.0.4 → 1.0.5

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 +6 -13
  2. metadata +2 -2
@@ -167,7 +167,8 @@ EOF
167
167
 
168
168
  h.each {|key, item| h.delete(key) if not h2.has_key? key}
169
169
  #refresh_doc
170
- #load_records
170
+ #load_records
171
+ @flat_records = @records.values.map{|x| x[:body]}
171
172
  rebuild_doc
172
173
  self
173
174
  end
@@ -404,23 +405,15 @@ end))
404
405
 
405
406
  def load_records
406
407
  @records = records_to_h
407
- @flat_records = flat_records_to_h
408
+
409
+ #Returns a ready-only snapshot of records as a simple Hash.
410
+ @flat_records = @records.values.map{|x| x[:body]}
408
411
  end
409
412
 
410
413
  def display()
411
414
  puts @doc.to_s
412
415
  end
413
-
414
- #Returns a ready-only snapshot of records as a simple Hash.
415
-
416
- def flat_records_to_h
417
- @doc.xpath('records/*').map do |row|
418
- row.xpath('*').inject({}) do |r,node|
419
- r.merge node.name.to_sym => node.text
420
- end
421
- end
422
- end
423
-
416
+
424
417
  def records_to_h()
425
418
 
426
419
  i = @doc.xpath('max(records/*/attribute::id)') || 0
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: 1.0.4
4
+ version: 1.0.5
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-15 00:00:00 +00:00
12
+ date: 2011-01-22 00:00:00 +00:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency