Skip to content

Commit

Permalink
Update 2021-02-04-coasters.md
Browse files Browse the repository at this point in the history
Format code to avoid horizontal scrolling
  • Loading branch information
Gabriel-Darbord authored Apr 17, 2024
1 parent ca9d48b commit 69ba77b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions _posts/2021-02-04-coasters.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,15 @@ Once I have created the collection, I can save it using the Moose export format
To do so, I execute the following snippet:

```st
'/my/collection/model.json' asFileReference ensureCreateFile writeStreamDo: [ :stream | model exportToJSONStream: stream ]
'/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 69ba77b

Please sign in to comment.