TiddlyWikiPharo/repository/TiddlyWiki/OrderedDictionary.extension.st

16 lines
454 B
Smalltalk
Raw Normal View History

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)
2023-07-04 15:58:12 +00:00
ifFalse: [
response customFields at: key put: value ]
ifTrue: [ response writeSlotNamed: key value: value ]
].
^ response
]