polyrex-objects 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/polyrex-objects.rb +10 -0
- metadata +2 -2
data/lib/polyrex-objects.rb
CHANGED
@@ -33,6 +33,16 @@ class PolyrexObjects
|
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
+
# implement the child_object within each class object
|
37
|
+
@class_names[0..-2].reverse.each_with_index do |class_name, k|
|
38
|
+
i = @class_names.length - (k + 1)
|
39
|
+
eval "#{@class_names[0]}.class_eval {
|
40
|
+
def records()
|
41
|
+
XPath.each(@node, 'records/*') {|record| yield(#{@class_names[i]}.new(record))}
|
42
|
+
end
|
43
|
+
}"
|
44
|
+
end
|
45
|
+
|
36
46
|
end
|
37
47
|
|
38
48
|
def to_a
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: polyrex-objects
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.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: 2010-06-
|
12
|
+
date: 2010-06-06 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|