dynarex 0.2.7 → 0.2.8
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/dynarex.rb +2 -2
- metadata +1 -1
data/lib/dynarex.rb
CHANGED
@@ -75,8 +75,8 @@ class Dynarex
|
|
75
75
|
end
|
76
76
|
|
77
77
|
def records_to_h(default_key)
|
78
|
-
ah = XPath.match(@doc.root, 'records/*').map do |row|
|
79
|
-
timestamp = Time.now.to_s; id =
|
78
|
+
ah = XPath.match(@doc.root, 'records/*').each_with_index.map do |row,i|
|
79
|
+
timestamp = Time.now.to_s; id = Time.now.strftime("%Y%m%I%H%M%S") + i.to_s
|
80
80
|
id = row.attribute('id').value.to_s if row.attribute('id')
|
81
81
|
timestamp = row.attribute('timestamp').value.to_s if row.attribute('timestamp')
|
82
82
|
body = XPath.match(row, '*').inject({}) do |r,node|
|