NeoJSON ignore some instance variables

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

NeoJSON ignore some instance variables

Peter Uhnak
Hi,

what is the best way to ignore instance variables when serializing with NeoJSON?

I figured out this so far...

(NeoJSONWriter on: stream)
for: Something
do: [ :mapping | mapping mapInstVars: mapping identifier instVarNames \ #(unwanted) ];
nextPut: aSomething

Thanks,
Peter
Reply | Threaded
Open this post in threaded view
|

Re: NeoJSON ignore some instance variables

Sven Van Caekenberghe-2


> On 25 Jul 2018, at 10:17, Peter Uhnák <[hidden email]> wrote:
>
> Hi,
>
> what is the best way to ignore instance variables when serializing with NeoJSON?
>
> I figured out this so far...
>
> (NeoJSONWriter on: stream)
> for: Something
> do: [ :mapping | mapping mapInstVars: mapping identifier instVarNames \ #(unwanted) ];
> nextPut: aSomething
>
> Thanks,
> Peter

That is a better and more beautiful way to do it then I would have come up with myself ;-)