Extending ordered dictionaries to be converted into tiddlers.
This commit is contained in:
parent
41ce14934c
commit
ff5a5ca804
13
repository/TiddlyWiki/OrderedDictionary.extension.st
Normal file
13
repository/TiddlyWiki/OrderedDictionary.extension.st
Normal 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
|
||||
]
|
Loading…
Reference in New Issue
Block a user