Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyan11 committed Aug 1, 2024
1 parent 916600a commit 2454f0b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
6 changes: 6 additions & 0 deletions src/Bloc-Serialization/BlElement.extension.st
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
Extension { #name : #BlElement }

{ #category : #'*Bloc-Serialization' }
BlElement >> materializeAsBlElement [

^ self
]

{ #category : #'*Bloc-Serialization' }
BlElement >> serialize [

Expand Down
15 changes: 8 additions & 7 deletions src/Bloc-Serialization/BlSerializer.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,21 @@ BlSerializer class >> allSerializer [
]

{ #category : #serialization }
BlSerializer class >> materialize: aString [
BlSerializer class >> materialize: anObject [

| serializerClassName serializerClass |
aString ifEmpty: [ ^ BlocMaterializationError new signal ].
(anObject isKindOf: BlElement) ifTrue: [ ^ anObject ].
anObject ifEmpty: [ ^ BlocMaterializationError new signal ].

aString first = $" ifFalse: [
^ self unknownMaterializerFor: aString ].
anObject first = $" ifFalse: [
^ self unknownMaterializerFor: anObject ].
serializerClassName := aString lines first allButFirst allButLast.
serializerClassName := anObject lines first allButFirst allButLast.
serializerClass := Smalltalk environment classNamed:
serializerClassName.
serializerClass ifNil: [ ^ self unknownMaterializerFor: aString ].
serializerClass ifNil: [ ^ self unknownMaterializerFor: anObject ].
^ serializerClass materialize: ('' join: aString lines allButFirst)
^ serializerClass materialize: ('' join: anObject lines allButFirst)
]
{ #category : #initialization }
Expand Down

0 comments on commit 2454f0b

Please sign in to comment.