polyrex-objects 0.7.4 → 0.7.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/polyrex-objects.rb +7 -3
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea133c4914858eeba43fee0b94637a6b21ab6968
|
4
|
+
data.tar.gz: 58d77ab3ef89643cec987f1c4683c23b5d490415
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f70e47da02f6a23e726bab79eb683a1fdbacd4c348e78e6c416589f93e4929df86da0a60c78a11d28e91195d492e9bfac98aece462ebaa94111ae785e24d27bc
|
7
|
+
data.tar.gz: b8c84f846171e4f5a6c97ccbfbefa59439b97f45718f0429a1fc44c517ed35ca75b91a710c20c3c636ae6ae41739c0ff2882f364d8f5e784f9b10703ad3c7315
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/polyrex-objects.rb
CHANGED
@@ -73,12 +73,15 @@ class PolyrexObjects
|
|
73
73
|
@@id = id
|
74
74
|
|
75
75
|
if schema then
|
76
|
+
|
76
77
|
a = schema.split('/')
|
77
78
|
a.shift
|
78
79
|
@class_names = []
|
79
80
|
|
80
81
|
a.each do |x|
|
82
|
+
|
81
83
|
name, raw_fields = x.split('[')
|
84
|
+
|
82
85
|
if raw_fields then
|
83
86
|
fields = raw_fields.chop.split(',').map &:strip
|
84
87
|
@class_names << name.capitalize
|
@@ -86,10 +89,11 @@ class PolyrexObjects
|
|
86
89
|
classx = []
|
87
90
|
classx << "class #{name.capitalize} < PolyrexObject"
|
88
91
|
classx << "def initialize(node=nil, id='0')"
|
89
|
-
classx << "
|
92
|
+
classx << " node ||= Rexle.new('<#{name}><summary/><records/></#{name}>').root"
|
93
|
+
classx << " super(node,id)"
|
90
94
|
|
91
|
-
classx << "a = node.xpath('summary/*',&:name)"
|
92
|
-
classx << "yaml_fields = a - (#{fields} + %w(format_mask))"
|
95
|
+
classx << " a = node.xpath('summary/*',&:name)"
|
96
|
+
classx << " yaml_fields = a - (#{fields} + %w(format_mask))"
|
93
97
|
classx << "yaml_fields.each do |field|"
|
94
98
|
classx << %q(instance_eval "def #{field}; YAML.load(@node.element('summary/#{field}/text()')); end")
|
95
99
|
classx << "end"
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|