polyrex 0.5.5 → 0.5.6

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/polyrex.rb +9 -1
  2. metadata +2 -2
data/lib/polyrex.rb CHANGED
@@ -61,6 +61,12 @@ class Polyrex
61
61
  def xpath(s)
62
62
  XPath.first(@doc.root, s)
63
63
  end
64
+
65
+ def records
66
+ XPath.each(@doc.root, "records/*") do |record|
67
+ yield(@objects_a[0].new(record))
68
+ end
69
+ end
64
70
 
65
71
  private
66
72
 
@@ -91,7 +97,9 @@ class Polyrex
91
97
 
92
98
  def load_handlers(schema)
93
99
  @create = PolyrexCreateObject.new(schema)
94
- @objects = PolyrexObjects.new(schema).to_h
100
+ objects = PolyrexObjects.new(schema)
101
+ @objects = objects.to_h
102
+ @objects_a = objects.to_a
95
103
  attach_create_handlers(@objects.keys)
96
104
  attach_edit_handlers(@objects)
97
105
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: polyrex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.5
4
+ version: 0.5.6
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-06-04 00:00:00 +01:00
12
+ date: 2010-06-06 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency