https://github.com/tannevaled/rson
Ruby Simple Object's Notation
https://github.com/tannevaled/rson
ruby ruby-gem serialization
Last synced: over 1 year ago
JSON representation
Ruby Simple Object's Notation
- Host: GitHub
- URL: https://github.com/tannevaled/rson
- Owner: tannevaled
- License: bsd-3-clause
- Created: 2016-04-13T19:19:17.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2017-02-13T21:47:19.000Z (over 9 years ago)
- Last Synced: 2025-03-12T15:51:23.286Z (over 1 year ago)
- Topics: ruby, ruby-gem, serialization
- Language: Ruby
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Ruby Simple Object's Notation
=============================
[](https://travis-ci.org/tannevaled/rson)
[](https://badge.fury.io/rb/rson)
[](https://codeclimate.com/github/tannevaled/rson)
[](https://codeclimate.com/github/tannevaled/rson/coverage)
[](https://codeclimate.com/github/tannevaled/rson)
RSON convert a string representation of Ruby simple objects to Ruby objects.
It does not use eval() but the parser gem to really parse strings.
## Supported Types :
- Integer
- Float
- Symbol
- String (multi-line)
- Nil
- TrueClass
- FalseClass
- Array
- Hash
## Examples
### Loading from a string
```ruby
require 'rson'
buffer = %q({ a: 1, 2 => true, 'c' => :d })
Serializer::RSON.load(buffer:buffer) # => { a: 1, 2 => true, 'c' => :d }
```
### Loading from a file
```ruby
require 'rson'
Serializer::RSON.load(
file_name:'config.rson',
file_path:'/etc/some_application'
) # => { a: 1, 2 => true, 'c' => :d }
```
## Installation
```bash
gem install rson
```