Re: [Pharo-users] [NeoJSON] creating custom maps

2017-02-01 Thread sergio ruiz
Looking at this now.. thanks! On January 30, 2017 at 4:41:59 PM, Sven Van Caekenberghe (s...@stfx.eu) wrote: The default is not to write out nil/null properties. If you want to change this, make a writer and set #writeNil: to false. For an example, see #testPointWriteNil  peace, sergio p

Re: [Pharo-users] [NeoJSON] creating custom maps

2017-01-30 Thread Sven Van Caekenberghe
> On 30 Jan 2017, at 22:32, sergio ruiz wrote: > > This works perfectly! > > one more question.. > > how would i go about changing the default behavior in this case for > NeoJSONWriter’s writeNil instance variable? I don't understand the question. The #writeNil property of NeoJSONWriter co

Re: [Pharo-users] [NeoJSON] creating custom maps

2017-01-30 Thread sergio ruiz
This works perfectly! one more question.. how would i go about changing the default behavior in this case for NeoJSONWriter’s writeNil instance variable?  Thanks! RadioStation class>>#neoJsonMapping: mapper mapper for: self do: [ :mapping | mapping mapInstVars ] peace, sergio pho

Re: [Pharo-users] [NeoJSON] creating custom maps

2017-01-27 Thread Sven Van Caekenberghe
Hi Sergio, You probably overlooked the option to add a mapping to the class side. Check the implementors of #neoJsonMapping: In your case, all you have to do is add the following method. RadioStation class>>#neoJsonMapping: mapper mapper for: self do: [ :mapping | mapping mapInstVars ] I can

[Pharo-users] [NeoJSON] creating custom maps

2017-01-27 Thread sergio ruiz
Okay, I am having the worst time with this.. i have a class called RadioStation that for now, just had  few text instance variables. all I really need to do is turn this into JSON.. i can do it with something like: String streamContents: [ :stream |    (NeoJSONWriter on: stream)       prettyPr