README.md in tjson-0.2.0 vs README.md in tjson-0.3.0
- old
+ new
@@ -53,11 +53,28 @@
### Generating
To generate TJSON from Ruby objects, use the `TJSON.generate` method:
```ruby
->> puts TJSON.generate({"foo" => "bar"})
+puts TJSON.generate({"foo" => "bar"})
{"foo:s:"bar"}
+```
+
+For better formatting, use the `TJSON.pretty_generate` method:
+
+```ruby
+puts TJSON.pretty_generate({"array-example" => [{"string-example" => "foobar", "binary-example" => "BINARY".encode(Encoding::BINARY), "float-example" => 0.42, "int-example" => 42, "timestamp-example" => Time.now}]})
+{
+ "array-example:A<O>": [
+ {
+ "string-example:s": "foobar",
+ "binary-example:b64": "QklOQVJZ",
+ "float-example:f": 0.42,
+ "int-example:i": "42",
+ "timestamp-example:t": "2016-11-06T22:27:34Z"
+ }
+ ]
+}
```
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/tjson/tjson-ruby