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.
- Integer
- Float
- Symbol
- String (multi-line)
- Nil
- TrueClass
- FalseClass
- Array
- Hash
require 'rson'
buffer = %q({ a: 1, 2 => true, 'c' => :d })
Serializer::RSON.load(buffer:buffer) # => { a: 1, 2 => true, 'c' => :d }
require 'rson'
Serializer::RSON.load(
file_name:'config.rson',
file_path:'/etc/some_application'
) # => { a: 1, 2 => true, 'c' => :d }
gem install rson