TiddlyWikiPharo/repository/TiddlyWiki/OrderedDictionary.extension.st

16 lines
454 B
Smalltalk
Raw Normal View History

2024-05-30 17:44:20 +00:00
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)
ifFalse: [
response customFields at: key put: value ]
ifTrue: [ response writeSlotNamed: key value: value ]
].
^ response
]