Extending ordered dictionaries to be converted into tiddlers.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2023-06-29 08:11:47 -05:00
parent 41ce14934c
commit ff5a5ca804

View File

@ -0,0 +1,13 @@
Extension { #name : #OrderedDictionary }
{ #category : #'*TiddlyWiki' }
OrderedDictionary >> asTiddler [
| tiddlerFields response |
response := Tiddler new.
tiddlerFields := response class slotNames copyWithoutAll: #('wiki' 'customFields').
self keysAndValuesDo: [ :key :value |
(tiddlerFields includes: key)
ifTrue: [ response writeSlotNamed: key value: value ]
].
^ response
]