[Cuis-dev] JSON encoding and decoding

Ezequiel Birman ebirman77 at gmail.com
Sun Jun 16 19:34:55 PDT 2024


There is *Json class >> renderInstanceVariables:of:on:*. It generates a
Dictionary. It still relies on Json class >> render, but may be enough for
what you are trying to do.

Example:
*Json renderInstanceVariables: Smalltalk class instVarNames of: Smalltalk
on: Transcript.*

On Mon, 17 Jun 2024 at 01:27, Mariano Montone via Cuis-dev <
cuis-dev at lists.cuis.st> wrote:

>
> El 16/6/24 a las 20:25, Mark Volkmann escribió:
> > The WebClient package can generate JSON from a Dictionary.
> > Does Cuis provide a method that generates a Dictionary from the
> > instance properties of an arbitrary Object?
> > I looked for a method in Object or Dictionary that does that
> > conversion and couldn't find one.
>
> I believe there's no such method. Try to implement it yourself. Look at
> #allInstVarNames and #instVarNamed: .
>
> If you fail, let me know and I will give it a try.
>
>
> --
> Cuis-dev mailing list
> Cuis-dev at lists.cuis.st
> https://lists.cuis.st/mailman/listinfo/cuis-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20240617/753ac42f/attachment-0001.htm>


More information about the Cuis-dev mailing list