News for hackers. Stuff that matters.
Re:Ask HN: What are some of the most elegant codebases in yo... by culi on Saturday June 17, 2023 @01:32PM (#36372347)
Ruby, being a Perl-inspired language, has `.to_json` built in. You can do

```rb

   # hashes
   { foo: 'bar' }.to_json
   
   # numbers
   28.to_json

   # anything really
   ['hello', 42, { lorem: "ipsum" }].to_json
```
Re:Ask HN: What are some of the most elegant codebases in yo... by viralpraxis on Saturday June 17, 2023 @04:01PM (#36373989)
That’s simply not true. This method is monkeypatched by json gem
Re:Ask HN: What are some of the most elegant codebases in yo... by quesera on Saturday June 17, 2023 @04:58PM (#36374515)
JSON has been in Ruby stdlib since at least 2.6 (2018)
Re:Ask HN: What are some of the most elegant codebases in yo... by michaelcampbell on Saturday June 17, 2023 @06:19PM (#36375285)
You're both right, I think.