polyrex-objects 0.8.2 → 0.8.3
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/lib/polyrex-objects.rb +13 -21
- data.tar.gz.sig +1 -1
- metadata +2 -2
- 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: b68af1bbeb21405d07f581ef6673bbfbf749424f
|
4
|
+
data.tar.gz: 7a5acc327b212f827aaebdaa0349a0f8a1dc86b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91e961df58842c4c435e4564b82ac55be85c7b143ba7a3cb88073d90763d1b689f4db9b4a23ba9760360efcbb2feffe603cecfbbee45919e4240b8a68027d8fe
|
7
|
+
data.tar.gz: 7b87fe4e590ab7df862322467046982f9df38442c70673dbf7bb553307bf838158802ff7eadcc073fdc2bdff10560be3b3b469c0cbcb7fc98d748fbb2bb45af9
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/polyrex-objects.rb
CHANGED
@@ -139,28 +139,20 @@ EOF
|
|
139
139
|
@schema = schema
|
140
140
|
|
141
141
|
if schema then
|
142
|
-
|
143
|
-
#a = schema.split('/')
|
144
|
-
#a.shift
|
145
|
-
a = schema.scan(/\w+\[[^\]]+\]/)
|
142
|
+
|
146
143
|
@class_names = []
|
147
144
|
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
name, raw_fields = s.split('[')
|
155
|
-
make_class(name, raw_fields)
|
156
|
-
end
|
157
|
-
else
|
158
|
-
name, raw_fields = x.split('[')
|
159
|
-
make_class(name, raw_fields)
|
145
|
+
h = PolyrexSchema.new(schema).to_h
|
146
|
+
|
147
|
+
scan = -> (a) do
|
148
|
+
a.each do |x|
|
149
|
+
make_class(x[:name], x[:fields], x[:schema])
|
150
|
+
scan.call(x[:children]) if x[:children]
|
160
151
|
end
|
161
|
-
|
162
152
|
end
|
163
153
|
|
154
|
+
scan.call h
|
155
|
+
|
164
156
|
if @class_names.length < 2 then
|
165
157
|
make_def_records(@class_names.first)
|
166
158
|
else
|
@@ -188,7 +180,7 @@ EOF
|
|
188
180
|
end
|
189
181
|
|
190
182
|
def to_a
|
191
|
-
@class_names.map {|x| eval(x)}
|
183
|
+
@class_names.map {|x| eval(x.to_s)}
|
192
184
|
end
|
193
185
|
|
194
186
|
def to_h
|
@@ -197,10 +189,10 @@ EOF
|
|
197
189
|
|
198
190
|
private
|
199
191
|
|
200
|
-
def make_class(name,
|
192
|
+
def make_class(name, fields, schema=@schema)
|
193
|
+
|
194
|
+
if fields then
|
201
195
|
|
202
|
-
if raw_fields then
|
203
|
-
fields = raw_fields.chop.split(',').map &:strip
|
204
196
|
@class_names << name.capitalize
|
205
197
|
|
206
198
|
classx = []
|
data.tar.gz.sig
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
�@����U��}w��]��`�B4!o�%���|Nx��� �<����\~�i�h��+�pAS���Sj�Ec��[�rTv����C�FQ֟�(�6�z�7�dJ�m�F���XP�� #�w����[����^���
|
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.8.
|
4
|
+
version: 0.8.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
C0ZUhP8IAGCVW8QD8AfZ/AgqUdh+zTRqKdhEyhXCjYyVXqNHnD02NbyGmQvgd9SD
|
32
32
|
XfuuGzQ3E4Mh5w==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2014-08-
|
34
|
+
date: 2014-08-09 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: polyrex-createobject
|
metadata.gz.sig
CHANGED
Binary file
|