Skip to content

Commit

Permalink
Update 2021-02-04-coasters.md
Browse files Browse the repository at this point in the history
`exportToJSON` no longer exists, replaced with a working snippet using `exportToJSONStream:`
  • Loading branch information
Gabriel-Darbord authored Apr 17, 2024
1 parent 1bb8147 commit ca9d48b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions _posts/2021-02-04-coasters.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,13 @@ Once I have created the collection, I can save it using the Moose export format
To do so, I execute the following snippet:

```st
model exportToJSON.
'/my/collection/model.json' asFileReference ensureCreateFile writeStreamDo: [ :stream | model exportToJSONStream: stream ]
```

Then I can select where I want to export my model.

To import it back into an image, I use the following code

```st
'/my/collection/model.json' asFileReference readStreamDo: [:stream | model := CCModel importFromJSONStream: stream ]
'/my/collection/model.json' asFileReference readStreamDo: [ :stream | model := CCModel importFromJSONStream: stream ]
```

0 comments on commit ca9d48b

Please sign in to comment.