polyrex-objects 0.7.4 → 0.7.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 00dc1f19e86c0e201e58a8ba544aa063f19a98ff
4
- data.tar.gz: 1687f3627475b598dcc4ad06efbcd6141a9971c4
3
+ metadata.gz: ea133c4914858eeba43fee0b94637a6b21ab6968
4
+ data.tar.gz: 58d77ab3ef89643cec987f1c4683c23b5d490415
5
5
  SHA512:
6
- metadata.gz: 96a8f98ba0c5954ad10628e1d6918df82a894fec5e9eace686a24f9444fac15028fc029ad6352e6ffaa2c62620a61d9330fae9a56fa27470dce21057e5b0b29e
7
- data.tar.gz: 127cf9ae69cfd08d6ceff09873002e9d52267a1626b9d31babfe674a47ca3aba05ff55d61d0c702bce064763614187aef1095d88c8048ab9f45e600a7eeb9403
6
+ metadata.gz: f70e47da02f6a23e726bab79eb683a1fdbacd4c348e78e6c416589f93e4929df86da0a60c78a11d28e91195d492e9bfac98aece462ebaa94111ae785e24d27bc
7
+ data.tar.gz: b8c84f846171e4f5a6c97ccbfbefa59439b97f45718f0429a1fc44c517ed35ca75b91a710c20c3c636ae6ae41739c0ff2882f364d8f5e784f9b10703ad3c7315
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -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 << "super(node,id)"
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
@@ -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.7.4
4
+ version: 0.7.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
Binary file