Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hash.str() should convert to a valid JSON string, closes #197
The main issue here is that when we convert to a string, we use the raw value of the AST object. The raw value for a string is `string`, but that is not valid json (should be `"string"`). Therefore, I added a new Json() method on all AST objects that should return a compatible JSON string, and it's used when we want to convert an hash (and all its key-values) to strings. ``` ⧐ {"string": "value", "array": [1,2,3,{"hash": [1,2,null]}]}.str() {"array": [1, 2, 3, {"hash": [1, 2, null]}], "string": "value"} ```
- Loading branch information
Showing
3 changed files
with
24 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters