xamplr 1.3.15 → 1.9.0

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 (163) hide show
  1. data/.gitignore +1 -0
  2. data/COPYING +160 -656
  3. data/LICENSE +1 -1
  4. data/README.md +33 -0
  5. data/Rakefile +2 -2
  6. data/VERSION.yml +2 -2
  7. data/lib/xamplr.rb +1 -0
  8. data/lib/xamplr/iterator.rb +123 -0
  9. data/lib/xamplr/xml-text.rb +5 -5
  10. data/xamplr.gemspec +9 -204
  11. metadata +13 -203
  12. data/README.rdoc +0 -46
  13. data/README.rdoc.orig +0 -118
  14. data/bin/xampl-gen +0 -17
  15. data/docs/intro/.gitignore +0 -1
  16. data/docs/intro/example1/example1.rb +0 -6
  17. data/docs/intro/example1/xml/hello.xml +0 -1
  18. data/docs/intro/example2/example2.rb +0 -38
  19. data/docs/intro/example2/project-generator.rb +0 -22
  20. data/docs/intro/example2/xml/hello.xml +0 -2
  21. data/docs/intro/example3/example3.rb +0 -30
  22. data/docs/intro/example3/example3a.rb +0 -16
  23. data/docs/intro/example3/generated.png +0 -0
  24. data/docs/intro/example3/grab-yuml.rb +0 -10
  25. data/docs/intro/example3/greeter.rb +0 -15
  26. data/docs/intro/example3/greeting.rb +0 -9
  27. data/docs/intro/example3/project-generator.rb +0 -25
  28. data/docs/intro/example3/xml/greeter.xml +0 -6
  29. data/docs/intro/example4/example4.rb +0 -27
  30. data/docs/intro/example4/example4a.rb +0 -19
  31. data/docs/intro/example4/grab-yuml.rb +0 -10
  32. data/docs/intro/example4/greeter.rb +0 -15
  33. data/docs/intro/example4/greeting.rb +0 -9
  34. data/docs/intro/example4/project-generator.rb +0 -25
  35. data/docs/intro/example4/xml/greeter.xml +0 -6
  36. data/docs/intro/grab-yuml.rb +0 -10
  37. data/docs/intro/project-generator.rb +0 -51
  38. data/docs/intro/xampl.lyx +0 -1494
  39. data/docs/intro/xampl.pdf +0 -0
  40. data/examples/employees/final-xampl/xampl-gen.rb +0 -38
  41. data/examples/employees/final-xampl/xml/ddd-final-xampl.xml +0 -86
  42. data/examples/employees/final/xampl-gen.rb +0 -38
  43. data/examples/employees/final/xml/ddd-final.xml +0 -86
  44. data/examples/employees/first/xampl-gen.rb +0 -38
  45. data/examples/employees/first/xml/ddd-first.xml +0 -48
  46. data/examples/employees/twist/twist.graphml +0 -333
  47. data/examples/employees/twist/xampl-gen.rb +0 -38
  48. data/examples/employees/twist/xml/twist.xml +0 -90
  49. data/examples/employees/xamplr-twist.xml +0 -2
  50. data/examples/employees/yuml-diagrams/DDD-final-approach.graphml +0 -393
  51. data/examples/employees/yuml-diagrams/DDD-final-xampl-approach.graphml +0 -265
  52. data/examples/employees/yuml-diagrams/DDD-ideal-final-approach.graphml +0 -357
  53. data/examples/employees/yuml-diagrams/ddd-final.png +0 -0
  54. data/examples/employees/yuml-diagrams/ddd-final.yuml +0 -8
  55. data/examples/employees/yuml-diagrams/ddd-first.png +0 -0
  56. data/examples/employees/yuml-diagrams/ddd-first.yuml +0 -7
  57. data/examples/employees/yuml-diagrams/final-yed.png +0 -0
  58. data/examples/employees/yuml-diagrams/first-yed.png +0 -0
  59. data/examples/employees/yuml-diagrams/twist.png +0 -0
  60. data/examples/employees/yuml-diagrams/twist.yuml +0 -12
  61. data/examples/employees/yuml-diagrams/xamplr-final-no-mixins.png +0 -0
  62. data/examples/employees/yuml-diagrams/xamplr-final-simplified.png +0 -0
  63. data/examples/employees/yuml-diagrams/xamplr-final-with-mixins.png +0 -0
  64. data/examples/employees/yuml-diagrams/yuml-simplified.txt +0 -19
  65. data/examples/employees/yuml-diagrams/yuml-with-mixins.txt +0 -53
  66. data/examples/employees/yuml-diagrams/yuml.txt +0 -27
  67. data/examples/hobbies/Makefile +0 -5
  68. data/examples/hobbies/hobbies.rb +0 -193
  69. data/examples/hobbies/project-generator.rb +0 -25
  70. data/examples/hobbies/xampl-gen.rb +0 -38
  71. data/examples/hobbies/xml/hobby.xml +0 -3
  72. data/examples/hobbies/xml/people.xml +0 -5
  73. data/examples/random-people-shared-addresses/.gitignore +0 -2
  74. data/examples/random-people-shared-addresses/Makefile +0 -15
  75. data/examples/random-people-shared-addresses/batch-load-users-profiled.rb +0 -91
  76. data/examples/random-people-shared-addresses/batch-load-users-safe.rb +0 -81
  77. data/examples/random-people-shared-addresses/batch-load-users.rb +0 -79
  78. data/examples/random-people-shared-addresses/find-mentions.rb +0 -47
  79. data/examples/random-people-shared-addresses/find-people-by-address.rb +0 -104
  80. data/examples/random-people-shared-addresses/optimise.rb +0 -16
  81. data/examples/random-people-shared-addresses/people.rb +0 -35
  82. data/examples/random-people-shared-addresses/query.rb +0 -75
  83. data/examples/random-people-shared-addresses/query2.rb +0 -73
  84. data/examples/random-people-shared-addresses/random-names.csv +0 -10000
  85. data/examples/random-people-shared-addresses/settings.rb +0 -3
  86. data/examples/random-people-shared-addresses/what-to-query-on.rb +0 -82
  87. data/examples/random-people-shared-addresses/xampl-gen.rb +0 -38
  88. data/examples/random-people-shared-addresses/xml/people.xml +0 -14
  89. data/examples/random-people/.gitignore +0 -2
  90. data/examples/random-people/Makefile +0 -20
  91. data/examples/random-people/batch-load-users.rb +0 -61
  92. data/examples/random-people/optimise.rb +0 -16
  93. data/examples/random-people/people.rb +0 -22
  94. data/examples/random-people/query.rb +0 -73
  95. data/examples/random-people/query2.rb +0 -73
  96. data/examples/random-people/random-names.csv +0 -10000
  97. data/examples/random-people/rawtc.rb +0 -91
  98. data/examples/random-people/settings.rb +0 -3
  99. data/examples/random-people/what-to-query-on.rb +0 -80
  100. data/examples/random-people/xampl-gen.rb +0 -39
  101. data/examples/random-people/xml/people.xml +0 -11
  102. data/examples/read-testing/.gitignore +0 -2
  103. data/examples/read-testing/Makefile +0 -10
  104. data/examples/read-testing/load.rb +0 -65
  105. data/examples/read-testing/read.rb +0 -51
  106. data/examples/read-testing/rrr.rb +0 -88
  107. data/examples/read-testing/settings.rb +0 -2
  108. data/examples/read-testing/xampl-gen.rb +0 -38
  109. data/examples/read-testing/xml/text.xml +0 -8
  110. data/examples/tokyo-cabinet-experimental/.gitignore +0 -2
  111. data/examples/tokyo-cabinet-experimental/expt-query.rb +0 -42
  112. data/examples/tokyo-cabinet-experimental/expt-query2.rb +0 -42
  113. data/examples/tokyo-cabinet-experimental/expt-query3.rb +0 -41
  114. data/examples/tokyo-cabinet-experimental/expt-reader.rb +0 -32
  115. data/examples/tokyo-cabinet-experimental/expt.rb +0 -61
  116. data/examples/tokyo-cabinet-experimental/xampl-gen.rb +0 -38
  117. data/examples/tokyo-cabinet-experimental/xml/tcx.xml +0 -6
  118. data/examples/write-testing/README +0 -4
  119. data/examples/write-testing/RESULTS.home +0 -33
  120. data/examples/write-testing/RESULTS.raconteur +0 -33
  121. data/examples/write-testing/write-speed-test.rb +0 -40
  122. data/lib/xampl-generator.rb +0 -3
  123. data/lib/xamplr-generator.rb +0 -9
  124. data/lib/xamplr/gen-elements.xml +0 -6230
  125. data/lib/xamplr/gen.elements.xml +0 -108
  126. data/lib/xamplr/generate-elements.rb +0 -15
  127. data/lib/xamplr/generator.rb +0 -5
  128. data/lib/xamplr/graphml-out.rb +0 -451
  129. data/lib/xamplr/handwritten/example.rb +0 -698
  130. data/lib/xamplr/handwritten/hand-example.rb +0 -533
  131. data/lib/xamplr/handwritten/test-handwritten.rb +0 -873
  132. data/lib/xamplr/my.gen.elements.xml +0 -461
  133. data/lib/xamplr/obsolete/fsdb.rb +0 -62
  134. data/lib/xamplr/simpleTemplate/danger.rx +0 -4
  135. data/lib/xamplr/simpleTemplate/obsolete/input-c.r4 +0 -35
  136. data/lib/xamplr/simpleTemplate/obsolete/play.r6.txt +0 -12
  137. data/lib/xamplr/simpleTemplate/obsolete/play_more.r6.txt +0 -20
  138. data/lib/xamplr/simpleTemplate/obsolete/test001.r5 +0 -8
  139. data/lib/xamplr/simpleTemplate/obsolete/test002.r5 +0 -13
  140. data/lib/xamplr/simpleTemplate/obsolete/test003.r5 +0 -37
  141. data/lib/xamplr/simpleTemplate/old/r6.000.rb +0 -122
  142. data/lib/xamplr/simpleTemplate/old/r6.001.rb +0 -145
  143. data/lib/xamplr/simpleTemplate/play.r6 +0 -12
  144. data/lib/xamplr/simpleTemplate/play_more.r6 +0 -20
  145. data/lib/xamplr/simpleTemplate/play_noblanks.r6 +0 -21
  146. data/lib/xamplr/simpleTemplate/playq.r6 +0 -16
  147. data/lib/xamplr/simpleTemplate/r6.rb +0 -87
  148. data/lib/xamplr/simpleTemplate/simple-template.rb +0 -75
  149. data/lib/xamplr/templates/.cvsignore +0 -3
  150. data/lib/xamplr/templates/child.template +0 -47
  151. data/lib/xamplr/templates/child_indexed.template +0 -89
  152. data/lib/xamplr/templates/child_modules.template +0 -5
  153. data/lib/xamplr/templates/element_classes.template +0 -11
  154. data/lib/xamplr/templates/element_data.template +0 -283
  155. data/lib/xamplr/templates/element_empty.template +0 -277
  156. data/lib/xamplr/templates/element_mixed.template +0 -278
  157. data/lib/xamplr/templates/element_simple.template +0 -277
  158. data/lib/xamplr/templates/package.template +0 -38
  159. data/lib/xamplr/xampl-cl-gen.rb +0 -89
  160. data/lib/xamplr/xampl-generator.rb +0 -569
  161. data/lib/xamplr/xampl-hand-generated.rb +0 -1535
  162. data/lib/xamplr/yEd-sample.graphml +0 -300
  163. data/lib/xamplr/yuml-out.rb +0 -129
@@ -1,698 +0,0 @@
1
- module XamplExample
2
-
3
- require "xamplr"
4
-
5
- module ThingsAsChild
6
-
7
- attr_accessor :things_child
8
-
9
- def init_things_as_child
10
- @things_child = []
11
- end
12
-
13
- def add_things(things)
14
- @children << things
15
- @things_child << things
16
- things.add_parent(self)
17
- changed
18
- return things
19
- end
20
-
21
- def new_things
22
- things = Things.new
23
- yield(things) if block_given?
24
- return add_things(things)
25
- end
26
-
27
- def remove_things(things)
28
- @things_child.delete(things)
29
- @children.delete(things)
30
- end
31
- end
32
-
33
- module ThingAsChild
34
-
35
- attr_accessor :thing_child, :thing_map
36
-
37
- def init_thing_as_child
38
- @thing_child = []
39
- @thing_map = {}
40
- end
41
-
42
- def add_thing(thing)
43
- index = thing.get_the_index
44
- if (nil == index) then
45
- throw "no index thing defined in : " << thing.to_xml
46
- end
47
-
48
- existing = @thing_map[index]
49
- remove_thing(existing) if existing
50
-
51
- @children << thing
52
- @thing_child << thing
53
- @thing_map[index] = thing
54
- thing.add_parent(self)
55
- changed
56
- return thing
57
- end
58
-
59
- def new_thing(index)
60
- thing = Thing.new
61
- thing.set_the_index(index)
62
- yield(thing) if block_given?
63
- return add_thing(thing)
64
- end
65
-
66
- def remove_thing(thing)
67
- index = thing.get_the_index
68
- if (nil == index) then
69
- throw "no index thing defined in : " << thing.to_xml
70
- end
71
-
72
- existing = @thing_map[index]
73
- if existing != thing then
74
- throw "will only remove the thing if it is already in the thing map"
75
- end
76
-
77
- @thing_map.delete(index)
78
- @thing_child.delete(thing)
79
- @children.delete(thing)
80
- end
81
- end
82
-
83
- module DescriptionAsChild
84
-
85
- attr_accessor :description_child
86
-
87
- def init_description_as_child
88
- @description_child = []
89
- end
90
-
91
- def add_description(description)
92
- @children << description
93
- @description_child << description
94
- description.add_parent(self)
95
- changed
96
- return description
97
- end
98
-
99
- def new_description
100
- description = Description.new
101
- yield(description) if block_given?
102
- return add_description(description)
103
- end
104
-
105
- def remove_description(description)
106
- @description_child.delete(description)
107
- @children.delete(description)
108
- end
109
- end
110
-
111
- module EmphAsChild
112
-
113
- attr_accessor :emph_child
114
-
115
- def init_emph_as_child
116
- @emph_child = []
117
- end
118
-
119
- def add_emph(emph)
120
- @children << emph
121
- @emph_child << emph
122
- emph.add_parent(self)
123
- changed
124
- return emph
125
- end
126
-
127
- def new_emph
128
- emph = Emph.new
129
- yield(emph) if block_given?
130
- return add_emph(emph)
131
- end
132
-
133
- def remove_emph(emph)
134
- @emph_child.delete(emph)
135
- @children.delete(emph)
136
- end
137
- end
138
-
139
- module KeyValueAsChild
140
-
141
- attr_accessor :key_value_child, :key_value_map
142
-
143
- def init_key_value_as_child
144
- @key_value_child = []
145
- @key_value_map = {}
146
- end
147
-
148
- def add_key_value(key_value)
149
- index = key_value.get_the_index
150
- if (nil == index) then
151
- throw "no index key_value defined in : " << key_value.to_xml
152
- end
153
-
154
- existing = @key_value_map[index]
155
- remove_key_value(existing) if existing
156
-
157
- @children << key_value
158
- @key_value_child << key_value
159
- @key_value_map[index] = key_value
160
- key_value.add_parent(self)
161
- changed
162
- return key_value
163
- end
164
-
165
- def new_key_value(index)
166
- key_value = KeyValue.new
167
- key_value.set_the_index(index)
168
- yield(key_value) if block_given?
169
- return add_key_value(key_value)
170
- end
171
-
172
- def remove_key_value(key_value)
173
- index = key_value.get_the_index
174
- if (nil == index) then
175
- throw "no index key_value defined in : " << key_value.to_xml
176
- end
177
-
178
- existing = @key_value_map[index]
179
- if existing != key_value then
180
- throw "will only remove the key_value if it is already in the key_value map"
181
- end
182
-
183
- @key_value_map.delete(index)
184
- @key_value_child.delete(key_value)
185
- @children.delete(key_value)
186
- end
187
- end
188
-
189
- module StuffAsChild
190
-
191
- attr_accessor :stuff_child
192
-
193
- def init_stuff_as_child
194
- @stuff_child = []
195
- end
196
-
197
- def add_stuff(stuff)
198
- @children << stuff
199
- @stuff_child << stuff
200
- stuff.add_parent(self)
201
- changed
202
- return stuff
203
- end
204
-
205
- def new_stuff
206
- stuff = Stuff.new
207
- yield(stuff) if block_given?
208
- return add_stuff(stuff)
209
- end
210
-
211
- def remove_stuff(stuff)
212
- @stuff_child.delete(stuff)
213
- @children.delete(stuff)
214
- end
215
- end
216
-
217
-
218
- class Things
219
- include Xampl::XamplPersistedObject
220
- include Xampl::XamplWithDataContent
221
-
222
- @@tag = "things"
223
- @@ns = "http://xampl.com/example"
224
- @@ns_tag = "{http://xampl.com/example}things"
225
- @@module_name = "XamplExample"
226
- @@attributes = [
227
- ]
228
-
229
- include ThingAsChild
230
-
231
- def Things.tag
232
- @@tag
233
- end
234
-
235
- def Things.ns
236
- @@ns
237
- end
238
-
239
- def Things.ns_tag
240
- @@ns_tag
241
- end
242
-
243
- def Things.module_name
244
- @@module_name
245
- end
246
-
247
- Xampl::FromXML::register(Things::tag, Things::ns_tag, Things)
248
-
249
-
250
- def initialize
251
- super
252
- init_xampl_object
253
-
254
-
255
- init_data_content
256
-
257
- init_thing_as_child
258
-
259
- yield(self) if block_given?
260
- changed
261
- end
262
-
263
- def append_to(other)
264
- other.add_things(self)
265
- end
266
-
267
- def tag
268
- @@tag
269
- end
270
-
271
- def ns
272
- @@ns
273
- end
274
-
275
- def ns_tag
276
- @@ns_tag
277
- end
278
-
279
- def module_name
280
- @@module_name
281
- end
282
-
283
- def attributes
284
- @@attributes
285
- end
286
- end
287
-
288
- class Thing
289
- include Xampl::XamplPersistedObject
290
- include Xampl::XamplWithDataContent
291
-
292
- @@tag = "thing"
293
- @@ns = "http://xampl.com/example"
294
- @@ns_tag = "{http://xampl.com/example}thing"
295
- @@module_name = "XamplExample"
296
- @@attributes = [
297
- [ :@pid, "pid" ],
298
- ]
299
-
300
- include DescriptionAsChild
301
- include KeyValueAsChild
302
- include StuffAsChild
303
- include ThingAsChild
304
- include ThingsAsChild
305
-
306
- attr_reader :pid
307
-
308
- def Thing.tag
309
- @@tag
310
- end
311
-
312
- def Thing.ns
313
- @@ns
314
- end
315
-
316
- def Thing.ns_tag
317
- @@ns_tag
318
- end
319
-
320
- def Thing.module_name
321
- @@module_name
322
- end
323
-
324
- Xampl::FromXML::register(Thing::tag, Thing::ns_tag, Thing)
325
-
326
- def pid=(v)
327
- changed
328
- @pid = v
329
- end
330
-
331
- def initialize
332
- super
333
- init_xampl_object
334
-
335
- @pid = nil if not defined? @pid
336
-
337
- init_data_content
338
-
339
- init_description_as_child
340
- init_key_value_as_child
341
- init_stuff_as_child
342
- init_thing_as_child
343
- init_things_as_child
344
-
345
- yield(self) if block_given?
346
- changed
347
- end
348
-
349
- def append_to(other)
350
- other.add_thing(self)
351
- end
352
-
353
- def tag
354
- @@tag
355
- end
356
-
357
- def ns
358
- @@ns
359
- end
360
-
361
- def ns_tag
362
- @@ns_tag
363
- end
364
-
365
- def module_name
366
- @@module_name
367
- end
368
-
369
- def attributes
370
- @@attributes
371
- end
372
-
373
- def get_the_index
374
- @pid
375
- end
376
-
377
- def set_the_index(index)
378
- @pid = index
379
- end
380
- end
381
-
382
- class Description
383
- include Xampl::XamplObject
384
- include Xampl::XamplWithMixedContent
385
-
386
- @@tag = "description"
387
- @@ns = "http://xampl.com/example"
388
- @@ns_tag = "{http://xampl.com/example}description"
389
- @@module_name = "XamplExample"
390
- @@attributes = [
391
- [ :@kind, "kind" ],
392
- ]
393
-
394
- include EmphAsChild
395
-
396
- attr_reader :kind
397
-
398
- def Description.tag
399
- @@tag
400
- end
401
-
402
- def Description.ns
403
- @@ns
404
- end
405
-
406
- def Description.ns_tag
407
- @@ns_tag
408
- end
409
-
410
- def Description.module_name
411
- @@module_name
412
- end
413
-
414
- Xampl::FromXML::register(Description::tag, Description::ns_tag, Description)
415
-
416
- def kind=(v)
417
- changed
418
- @kind = v
419
- end
420
-
421
- def initialize
422
- super
423
- init_xampl_object
424
-
425
- @kind = nil if not defined? @kind
426
-
427
- init_mixed_content
428
-
429
- init_emph_as_child
430
-
431
- yield(self) if block_given?
432
- changed
433
- end
434
-
435
- def append_to(other)
436
- other.add_description(self)
437
- end
438
-
439
- def tag
440
- @@tag
441
- end
442
-
443
- def ns
444
- @@ns
445
- end
446
-
447
- def ns_tag
448
- @@ns_tag
449
- end
450
-
451
- def module_name
452
- @@module_name
453
- end
454
-
455
- def attributes
456
- @@attributes
457
- end
458
- end
459
-
460
- class Emph
461
- include Xampl::XamplObject
462
- include Xampl::XamplWithSimpleContent
463
-
464
- @@tag = "emph"
465
- @@ns = "http://xampl.com/example"
466
- @@ns_tag = "{http://xampl.com/example}emph"
467
- @@module_name = "XamplExample"
468
- @@attributes = [
469
- ]
470
-
471
-
472
- def Emph.tag
473
- @@tag
474
- end
475
-
476
- def Emph.ns
477
- @@ns
478
- end
479
-
480
- def Emph.ns_tag
481
- @@ns_tag
482
- end
483
-
484
- def Emph.module_name
485
- @@module_name
486
- end
487
-
488
- Xampl::FromXML::register(Emph::tag, Emph::ns_tag, Emph)
489
-
490
-
491
- def initialize
492
- super
493
- init_xampl_object
494
-
495
-
496
-
497
- yield(self) if block_given?
498
- changed
499
- end
500
-
501
- def append_to(other)
502
- other.add_emph(self)
503
- end
504
-
505
- def tag
506
- @@tag
507
- end
508
-
509
- def ns
510
- @@ns
511
- end
512
-
513
- def ns_tag
514
- @@ns_tag
515
- end
516
-
517
- def module_name
518
- @@module_name
519
- end
520
-
521
- def attributes
522
- @@attributes
523
- end
524
- end
525
-
526
- class KeyValue
527
- include Xampl::XamplObject
528
- include Xampl::XamplWithoutContent
529
-
530
- @@tag = "keyValue"
531
- @@ns = "http://xampl.com/example"
532
- @@ns_tag = "{http://xampl.com/example}keyValue"
533
- @@module_name = "XamplExample"
534
- @@attributes = [
535
- [ :@id, "id" ],
536
- [ :@value, "value" ],
537
- ]
538
-
539
-
540
- attr_reader :id
541
- attr_reader :value
542
-
543
- def KeyValue.tag
544
- @@tag
545
- end
546
-
547
- def KeyValue.ns
548
- @@ns
549
- end
550
-
551
- def KeyValue.ns_tag
552
- @@ns_tag
553
- end
554
-
555
- def KeyValue.module_name
556
- @@module_name
557
- end
558
-
559
- Xampl::FromXML::register(KeyValue::tag, KeyValue::ns_tag, KeyValue)
560
-
561
- def id=(v)
562
- changed
563
- @id = v
564
- end
565
-
566
- def value=(v)
567
- changed
568
- @value = v
569
- end
570
-
571
- def initialize
572
- super
573
- init_xampl_object
574
-
575
- @id = nil if not defined? @id
576
- @value = nil if not defined? @value
577
-
578
-
579
- yield(self) if block_given?
580
- changed
581
- end
582
-
583
- def append_to(other)
584
- other.add_key_value(self)
585
- end
586
-
587
- def tag
588
- @@tag
589
- end
590
-
591
- def ns
592
- @@ns
593
- end
594
-
595
- def ns_tag
596
- @@ns_tag
597
- end
598
-
599
- def module_name
600
- @@module_name
601
- end
602
-
603
- def attributes
604
- @@attributes
605
- end
606
-
607
- def get_the_index
608
- @id
609
- end
610
-
611
- def set_the_index(index)
612
- @id = index
613
- end
614
- end
615
-
616
- class Stuff
617
- include Xampl::XamplObject
618
- include Xampl::XamplWithoutContent
619
-
620
- @@tag = "stuff"
621
- @@ns = "http://xampl.com/example"
622
- @@ns_tag = "{http://xampl.com/example}stuff"
623
- @@module_name = "XamplExample"
624
- @@attributes = [
625
- [ :@kind, "kind" ],
626
- [ :@special, "special", "http://xampl.com/example/special" ],
627
- ]
628
-
629
-
630
- attr_reader :kind
631
- attr_reader :special
632
-
633
- def Stuff.tag
634
- @@tag
635
- end
636
-
637
- def Stuff.ns
638
- @@ns
639
- end
640
-
641
- def Stuff.ns_tag
642
- @@ns_tag
643
- end
644
-
645
- def Stuff.module_name
646
- @@module_name
647
- end
648
-
649
- Xampl::FromXML::register(Stuff::tag, Stuff::ns_tag, Stuff)
650
-
651
- def kind=(v)
652
- changed
653
- @kind = v
654
- end
655
-
656
- def special=(v)
657
- changed
658
- @special = v
659
- end
660
-
661
- def initialize
662
- super
663
- init_xampl_object
664
-
665
- @kind = nil if not defined? @kind
666
- @special = nil if not defined? @special
667
-
668
-
669
- yield(self) if block_given?
670
- changed
671
- end
672
-
673
- def append_to(other)
674
- other.add_stuff(self)
675
- end
676
-
677
- def tag
678
- @@tag
679
- end
680
-
681
- def ns
682
- @@ns
683
- end
684
-
685
- def ns_tag
686
- @@ns_tag
687
- end
688
-
689
- def module_name
690
- @@module_name
691
- end
692
-
693
- def attributes
694
- @@attributes
695
- end
696
- end
697
-
698
- end