polyrex-objects 0.4.4 → 0.4.5

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 +10 -1
  2. metadata +1 -1
@@ -8,8 +8,11 @@ require 'polyrex-createobject'
8
8
  class PolyrexObjects
9
9
  include REXML
10
10
 
11
- def initialize(schema)
11
+ def initialize(schema, node=nil, id=nil)
12
12
 
13
+ @node = node
14
+ @id = id
15
+
13
16
  a = schema.split('/')
14
17
  a.shift
15
18
  @class_names = []
@@ -53,6 +56,12 @@ class PolyrexObjects
53
56
 
54
57
  }"
55
58
  end
59
+
60
+ methodx = @class_names.map do |name|
61
+ %Q(def #{name.downcase}(); #{name}.new(@node, @id); end)
62
+ end
63
+
64
+ self.instance_eval(methodx.join("\n"))
56
65
 
57
66
 
58
67
  end
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.4
4
+ version: 0.4.5
5
5
  platform: ruby
6
6
  authors: []
7
7