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

29 lines
811 B
Smalltalk

Extension { #name : #LeModel }
{ #category : #'*Grafoscopio-Utils-Core' }
LeModel >> metadata [
^ self optionAt: 'metadata' ifAbsent: [ self optionAt: 'metadata' put: self metadataInit ]
]
{ #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.
]
{ #category : #'*Grafoscopio-Utils-Core' }
LeModel >> metadataInit [
^ OrderedDictionary new
at: 'id' put: self uidString;
at: 'created' put: self createTime asString;
at: 'modified' put: self latestEditTime asString;
at: 'creator' put: self createEmail asString;
at: 'modifier' put: self editEmail asString;
yourself
]