Skip to content

Commit

Permalink
Move NeoJSON extensions to its own package
Browse files Browse the repository at this point in the history
  • Loading branch information
gcotelli committed Sep 13, 2023
1 parent e2bf46c commit 54848b9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions source/BaselineOfStargate/BaselineOfStargate.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ BaselineOfStargate >> setUpCorePackages: spec [
group: 'Core' with: 'Stargate-Model';
group: 'Deployment' with: 'Stargate-Model'.

#( 'Stargate-Zinc-Extensions' 'Stargate-Teapot-Extensions' ) do: [
:extensionPackageName |
#( 'Stargate-Zinc-Extensions' 'Stargate-Teapot-Extensions'
'Stargate-NeoJSON-Extensions' ) do: [ :extensionPackageName |
spec
package: extensionPackageName
with: [ spec requires: 'Stargate-Model' ];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #NeoJSONObject }

{ #category : #'*Stargate-Model' }
{ #category : #'*Stargate-NeoJSON-Extensions' }
NeoJSONObject >> selfLocation [

^ self links self
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
Extension { #name : #NeoJSONObjectMapping }

{ #category : #'*Stargate-Model' }
{ #category : #'*Stargate-NeoJSON-Extensions' }
NeoJSONObjectMapping >> mapAsHypermediaControls: aBlock [

self
mapProperty: #links
getter: [ :object | ( ( aBlock cull: object ) collect: [ :assoc | assoc key -> assoc value printString ] ) asDictionary ]
]

{ #category : #'*Stargate-Model' }
{ #category : #'*Stargate-NeoJSON-Extensions' }
NeoJSONObjectMapping >> mapProperty: propertyName getter: readBlock [

^ self mapProperty: propertyName getter: readBlock setter: [ :object :value | ]
]

{ #category : #'*Stargate-Model' }
{ #category : #'*Stargate-NeoJSON-Extensions' }
NeoJSONObjectMapping >> mapProperty: propertyName setter: writeBlock [

^ self mapProperty: propertyName getter: [ :object | ] setter: writeBlock
Expand Down
1 change: 1 addition & 0 deletions source/Stargate-NeoJSON-Extensions/package.st
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Package { #name : #'Stargate-NeoJSON-Extensions' }

0 comments on commit 54848b9

Please sign in to comment.