polyrex-objects 0.4.8 → 0.4.9

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/polyrex-objects.rb +6 -1
  2. metadata +1 -1
@@ -26,7 +26,10 @@ class PolyrexObjects
26
26
  classx = []
27
27
  classx << "class #{name.capitalize}"
28
28
  classx << "include REXML"
29
- classx << "def initialize(node, id=nil); @id=id; @node = node; @create = PolyrexCreateObject.new('#{schema}'); end"
29
+ classx << "def initialize(node, id=nil)"
30
+ classx << "@id=id; @node = node;"
31
+ classx << "@create = PolyrexCreateObject.new('#{schema}')"
32
+ classx << "end"
30
33
  fields.each do |field|
31
34
  classx << "def #{field}; XPath.first(@node, 'summary/#{field}/text()'); end"
32
35
  classx << "def #{field}=(text); XPath.first(@node, 'summary/#{field}').text = text; end"
@@ -43,6 +46,8 @@ class PolyrexObjects
43
46
  i = @class_names.length - (k + 1)
44
47
  eval "#{class_name}.class_eval {
45
48
  def records()
49
+ puts 'testing '
50
+ puts @node.to_s
46
51
  XPath.match(@node, 'records/*').map {|record| #{@class_names[i]}.new(record)}
47
52
  end
48
53
 
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.8
4
+ version: 0.4.9
5
5
  platform: ruby
6
6
  authors: []
7
7