RoloLudo/RoloLudo.package/SfTruthOption.class/instance/subtableAsWikiText.st

10 lines
342 B
Smalltalk

accessing
subtableAsWikiText
| stream chances |
stream := '' writeStream.
self subtable ifEmpty: [ ^ stream contents ].
chances := self subtable collect: [ :each | each at: 'Chance' ].
chances doWithIndex: [:ch :i |
stream nextPutAll: '| ', ch asString, ' |', ((self subtable at: i) at: 'Description'), ' |' ; cr
].
^ stream contents