2.6.2Functions
Decode an item stored in JSON format.
JSONdecode( source )
| source | A string or a stream from which to read the JSON data. |
| Return | a string containing the JSON string, if stream is nil |
| Raise |
| JSONError | if the input data cannot be parsed. |
| IoError | in case of error on the source stream. |
|
Encode an item in JSON format.
JSONencode( item, [stream],[pretty],[readable] )
| item | the item to be encoded in JSON format. |
| stream | A stream on which to send the encoded result. |
| pretty | Add spacing around separators and puntaction. |
| readable | Put each item in lists on a separate line. |
| Return | a string containing the JSON string, if stream is nil |
| Raise |
| JSONError | if the passed item cannot be turned into a JSON representation. |
| IoError | in case of error on target stream. |
|