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)
      prettyPrint: true;
      mapInstVarsFor: RadioStation;
      nextPut: (RadioStation SelectAll last) ]. 
      
but this seems like massive overkill.. plus, very soon, this is going to have 
collections of other objects..

also, since this returns a string.. when Teapot returns this, it escapes all of 
the “s and produces illegal json, as it’s just a string..

i read about mappers, but i can’t figure out how to create them..

doing something simple like:

| mapper server |
mapper := NeoJSONMapper new.

mapper mapAllInstVarsFor: RadioStation.
mapper mappings.

NeoJSONWriter toString: station.

which feels like it should work, gives me:

No mapping found for RadioStation in NeoJSONWriter

any help?

thanks so much!

----
peace,
sergio
photographer, journalist, visionary

Public Key: http://bit.ly/29z9fG0
#BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
http://www.Village-Buzz.com
http://www.ThoseOptimizeGuys.com
http://www.coffee-black.com
http://www.painlessfrugality.com
http://www.twitter.com/sergio_101
http://www.facebook.com/sergio101

Attachment: signature.asc
Description: Message signed with OpenPGP using AMPGpg

Reply via email to