Sha256: 3372a1d5af522ecd08d2aa8b8bbd640f0e03b4744f1e7e6d32a06426bcab0a91

Contents?: true

Size: 1.18 KB

Versions: 1

Compression:

Stored size: 1.18 KB

Contents

# TidyJson

[![Build Status](https://travis-ci.com/rdipardo/tidy_json.svg)](https://travis-ci.com/rdipardo/tidy_json)

A mixin providing (recursive) JSON serialization and pretty printing.

### Installation

#### Minimal

```bash
    $ gem install tidy_json
```

#### Development (tests, YARD docs)

```bash
    $ gem install -​-development tidy_json
```

Or, with `bundler`:

```ruby
source 'https://rubygems.org'
# ...
gem 'tidy_json'
# ...
```

### Example

```ruby
require 'tidy_json'

JSON.parse [].stringify
# => {"class"=>"Array"}

complex_object = { :a => 1, :b => ['two', 3, '<abbr title="four">IV</abbr>'] }
# => {:a=>1, :b=>["two", 3, "<abbr title=\"four\">IV</abbr>"]}

puts complex_object.to_tidy_json
# {
# "a": 1,
# "b":
#   [
#     "two",
#     3,
#     "<abbr title=\"four\">IV</abbr>"
#   ]
# }
# => nil
```

### Dependencies

#### Runtime
- [json](https://rubygems.org/gems/json) ~> 2.2

#### Building
- [bundler](https://rubygems.org/gems/bundler) ~> 2.1
- [minitest](https://rubygems.org/gems/minitest) ~> 5.0
- [yard](https://rubygems.org/gems/yard) ~> 0.9

### License
[MIT](https://opensource.org/licenses/MIT)

### Author
[Robert Di Pardo](mailto:rdipardo0520@conestogac.on.ca)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tidy_json-0.1.1 README.md