https://github.com/sage/json_kit
https://github.com/sage/json_kit
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/sage/json_kit
- Owner: Sage
- License: mit
- Created: 2016-07-07T07:33:26.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2024-01-03T16:11:46.000Z (over 2 years ago)
- Last Synced: 2025-04-20T12:59:23.500Z (over 1 year ago)
- Language: Ruby
- Size: 22.5 KB
- Stars: 0
- Watchers: 18
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# JsonKit
[](https://travis-ci.org/Sage/json_kit)
[](https://codeclimate.com/github/Sage/json_kit/maintainability)
[](https://codeclimate.com/github/Sage/json_kit/test_coverage)
[](https://badge.fury.io/rb/json_kit)
Welcome to your JsonKit! JsonKit is a toolkit for working with json.
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'json_kit'
```
And then execute:
```bash
$ bundle
```
Or install it yourself as:
```bash
$ gem install json_kit
```
## Usage
#JsonKit::Helper
This is class contains helper methods for working with json.
## #to_json
This method is called to convert an object to a json string. (This can be a class instance or hash)
```ruby
json = helper.to_json(obj)
```
## #from_json
This method is called to convert a json string to an ruby object.
```ruby
hash = helper.from_json(json)
....
#json_kit uses hash_kit so supports specifying a class name and transforms to convert the json into a ruby class instance.
obj = helper.from_json(json, TestEntity, transforms)
```
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/sage/json_kit. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
## License
This gem is available as open source under the terms of the
[MIT licence](LICENSE).
Copyright (c) 2018 Sage Group Plc. All rights reserved.