dynarex 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/dynarex.rb +7 -2
  2. metadata +2 -2
@@ -74,12 +74,17 @@ class Dynarex
74
74
  end
75
75
 
76
76
  def records_to_h
77
- XPath.match(@doc.root, 'records/*').map do |row|
78
- XPath.match(row, '*').inject({}) do |r,node|
77
+ ah = XPath.match(doc.root, 'records/*').map do |row|
78
+ timestamp = Time.now.to_s; id = ''
79
+ id = row.attribute('id').value.to_s if row.attribute('id')
80
+ timestamp = row.attribute('timestamp').value.to_s if row.attribute('timestamp')
81
+ body = XPath.match(row, '*').inject({}) do |r,node|
79
82
  r[node.name.to_s.to_sym] = node.text.to_s
80
83
  r
81
84
  end
85
+ [timestamp,{id: id, body: body}]
82
86
  end
87
+ Hash[ah]
83
88
  end
84
89
 
85
90
  def summary_to_h
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.1.6
4
+ version: 0.1.7
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: 2010-03-29 00:00:00 +01:00
12
+ date: 2010-04-06 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies: []
15
15