GrafoscopioUtils/repository/Grafoscopio-Utils/LeModel.extension.st

25 lines
675 B
Smalltalk
Raw Normal View History

2022-01-30 18:57:25 +00:00
Extension { #name : #LeModel }
{ #category : #'*Grafoscopio-Utils-Core' }
LeModel >> metadata [
^ OrderedDictionary new
at: 'id' put: self uidString;
at: 'parent' put: self parent uidString;
at: 'created' put: self createTime asString;
at: 'edited' put: self latestEditTime asString;
at: 'creator' put: self createEmail asString;
at: 'editor' put: self editEmail asString;
yourself.
]
{ #category : #'*Grafoscopio-Utils-Core' }
LeModel >> metadataDiv [
| output |
output := '' writeStream.
output
nextPutAll: '<div st-class="', self class asString, '"'; lf;
nextPutAll: ' st-data="', (STON toString: self metadata), '">'; lf.
^ output contents.
]